LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/aparrish[P]rwet-examples-c/randlines.c
// Function: main
int main(int argc, char* argv[]) {

	srand(time(NULL));

	/* read in lines */
	line_t* head;
	line_t* last = NULL;
	line_t* current = NULL;
	while (!feof(stdin)) {
		/* malloc a new line_t */
		current = malloc(sizeof(line_t));
		current->next = NULL;
		current->line_no = line_count;

		/* ap_getline populates current->line with pointer to malloced char* */
		current->len = ap_getline(&(current->line), stdin);

		/* set this line_t as the 'next' of previous line_t */
		if (last == NULL) {
			head = current;
		}
		else {
			last->next = current;
		}
		last = current;
		line_count++;
	}

	/* print lines out randomly, removing from linked list as it goes */
	int offset;
	int i;
	line_t* current_line = NULL;
	line_t* prev_line = NULL;
	while (line_count > 0) {
		prev_line = NULL;
		current_line = head;
		offset = rand() % line_count; /* random offset from head of list */

		/* traverse the list until we get to offset, keeping track of previous
 		 * node (so we can remove the node at offset) */
		for (i = 0; i < offset; i++) {
			prev_line = current_line;
			current_line = current_line->next;
		}
		printf("%s", current_line->line);

		/* if offset was zero, the next line is the new head of the list */
		if (offset == 0) 
			head = current_line->next;

		/* the previous line's next now points to the current line's next */
		if (prev_line != NULL)
			prev_line->next = current_line->next;

		/* free the line and the struct */
		free(current_line->line);
		free(current_line);

		line_count--;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x1070
movl %eax, %edi
callq 0x1050
movq 0x2e01(%rip), %r13      # 0x3fe0
pushq $0x18
popq %rbx
movq (%r13), %rdi
callq 0x1060
testl %eax, %eax
jne 0x1237
movq %rbx, %rdi
callq 0x1080
movq %rax, %r14
andq $0x0, 0x10(%rax)
movl 0x2e6f(%rip), %eax      # 0x4074
movl %eax, 0x8(%r14)
movq (%r13), %rsi
movq %r14, %rdi
callq 0x12cc
movl %eax, 0xc(%r14)
movq %r14, %rax
testq %r12, %r12
je 0x1229
movq %r14, 0x10(%r12)
movq %r15, %rax
incl 0x2e45(%rip)            # 0x4074
movq %r14, %r12
movq %rax, %r15
jmp 0x11e2
movl 0x2e37(%rip), %eax      # 0x4074
leaq 0xdc0(%rip), %rbx       # 0x2004
testl %eax, %eax
jle 0x12ba
callq 0x10b0
cltd
idivl 0x2e20(%rip)            # 0x4074
movl %edx, %ebp
testl %edx, %edx
movl $0x0, %eax
cmovgl %edx, %eax
movq %r15, %rcx
xorl %r12d, %r12d
movq %rcx, %r14
subl $0x1, %eax
jb 0x1277
movq 0x10(%r14), %rcx
movq %r14, %r12
jmp 0x1266
movq (%r14), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1040
testl %ebp, %ebp
jne 0x128c
movq 0x10(%r14), %r15
testq %r12, %r12
je 0x129a
movq 0x10(%r14), %rax
movq %rax, 0x10(%r12)
movq (%r14), %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movl 0x2dc4(%rip), %eax      # 0x4074
decl %eax
movl %eax, 0x2dbc(%rip)      # 0x4074
jmp 0x1244
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/richarddurbin[P]hash10x/moshasm.c
// Function: readsetCreate
Readset *readsetCreate (Moshset *ms, int n) /* create empty - n is used to initialise arrays */
{
  Readset *rs = new0 (1, Readset) ;
  rs->ms = ms ;
  rs->reads = arrayCreate (n, Read) ;
  arrayp(rs->reads,0,Read)->nHit = 0 ; /* burn first read, so can use 0 as null */
  /* create inv, invSpace in invBuild() */
  return rs ;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x65c4
movq %rax, %r15
movq %r14, (%rax)
pushq $0x48
popq %rsi
movl %ebx, %edi
callq 0x5d68
movq %rax, 0x8(%r15)
movq %rax, %rdi
xorl %esi, %esi
callq 0x6000
andl $0x0, 0x4(%rax)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/richarddurbin[P]hash10x/moshasm.c
// Function: readsetDestroy
void readsetDestroy (Readset *rs)
{
  int i, n = arrayMax(rs->reads) ; Read *r = arrp(rs->reads,0,Read) ;
  for (i = 0 ; i < n ; ++i, ++r) if (r->nHit) { free(r->hit) ; free(r->dx) ; }
  arrayDestroy (rs->reads) ;
  if (rs->inv) { free (rs->inv) ; free (rs->invSpace) ; }
  free (rs) ;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rax
movl 0x18(%rax), %ecx
movq 0x8(%rax), %r14
xorl %ebp, %ebp
testl %ecx, %ecx
cmovgl %ecx, %ebp
addq $0x10, %r14
subl $0x1, %ebp
jb 0x13ec
cmpl $0x0, -0xc(%r14)
je 0x13e6
movq -0x8(%r14), %rdi
callq 0x1040
movq (%r14), %rdi
callq 0x1040
addq $0x48, %r14
jmp 0x13c9
movq 0x8(%rbx), %rdi
callq 0x5ea8
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x140c
callq 0x1040
movq 0x20(%rbx), %rdi
callq 0x1040
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O2/richarddurbin[P]hash10x/moshasm.c
// Function: readsetWrite
void readsetWrite (Readset *rs, char *root)
{
  FILE *f ;
  if (!(f = fopenTag (root, "mosh", "w"))) die ("can't open file %s.mosh", root) ;
  moshsetWrite (rs->ms, f) ; fclose (f) ;
  if (!(f = fopenTag (root, "readset", "w"))) die ("can't open file %s.readset", root) ;
  if (fwrite("RSMSHv2",8,1,f) != 1) die ("failed to write readset header") ;
  if (fwrite (&rs->totHit,sizeof(U64),1,f) != 1) die ("failed to write totHit") ;
  arrayWrite (rs->reads, f) ;
  int i, n ; Read *r = arrp(rs->reads,0,Read) ;
  for (i = 0 ; i < arrayMax(rs->reads) ; ++i, ++r)
    if ((n = r->nHit))
      { if (fwrite(r->hit,sizeof(U32),n,f) != n) die ("failed write hits %d", n) ;
	if (fwrite(r->dx,sizeof(U16),n,f) != n) die ("failed write dx %d", n) ;
      }
  fclose (f) ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x5c1d(%rip), %rsi      # 0x704d
leaq 0x5c01(%rip), %rdx      # 0x7038
movq %r15, %rdi
callq 0x6715
movq %rax, %r14
testq %rax, %rax
jne 0x1458
leaq 0x5bec(%rip), %rdi      # 0x703a
movq %r15, %rsi
xorl %eax, %eax
callq 0x64dc
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x4d6d
movq %r14, %rdi
callq 0x10a0
leaq 0x5bf3(%rip), %rsi      # 0x7065
leaq 0x5bbf(%rip), %rdx      # 0x7038
movq %r15, %rdi
callq 0x6715
movq %rax, %r14
testq %rax, %rax
jne 0x149a
leaq 0x5bc2(%rip), %rdi      # 0x7052
movq %r15, %rsi
xorl %eax, %eax
callq 0x64dc
leaq 0x5c61(%rip), %rdi      # 0x7102
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x1230
cmpq $0x1, %rax
je 0x14c3
leaq 0x5bb1(%rip), %rdi      # 0x706d
xorl %eax, %eax
callq 0x64dc
leaq 0x10(%rbx), %rdi
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x1230
cmpq $0x1, %rax
je 0x14e9
leaq 0x5baa(%rip), %rdi      # 0x708c
xorl %eax, %eax
callq 0x64dc
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x60e6
movq 0x8(%rbx), %rax
movq 0x8(%rax), %rbp
addq $0x10, %rbp
pushq $0x2
popq %r12
xorl %r15d, %r15d
cmpl 0x18(%rax), %r15d
jge 0x1574
movslq -0xc(%rbp), %r13
testq %r13, %r13
je 0x1567
movq -0x8(%rbp), %rdi
pushq $0x4
popq %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x1230
cmpq %r13, %rax
je 0x153f
leaq 0x5b6e(%rip), %rdi      # 0x70a3
movl %r13d, %esi
xorl %eax, %eax
callq 0x64dc
movq (%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x1230
cmpq %r13, %rax
je 0x1567
leaq 0x5b5b(%rip), %rdi      # 0x70b8
movl %r13d, %esi
xorl %eax, %eax
callq 0x64dc
incl %r15d
movq 0x8(%rbx), %rax
addq $0x48, %rbp
jmp 0x1508
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10a0
// File: /workspace/github_c_makefile_star2_O2/richarddurbin[P]hash10x/moshasm.c
// Function: invBuild
static void invBuild (Readset *rs) /* run this after ms->depth built from reads->hit[] */
{
  Moshset *ms = rs->ms ;
  U32 i, j ;
  U64 offset = 0 ;
  rs->inv = new0 (ms->max+1, U32*) ;
  rs->invSpace = new (rs->totHit, U32) ;
  for (i = 1 ; i <= ms->max ; ++i)
    if (ms->depth[i] && ms->depth[i] < U16MAX)
      { rs->inv[i] = rs->invSpace + offset ;
	offset += ms->depth[i] ;
      }
  Read *read = arrp(rs->reads,1,Read) ;
  for (i = 1 ; i < arrayMax(rs->reads) ; ++i, ++read)
    { for (j = 0 ; j < 4 ; ++j) read->nCopy[j] = 0 ; /* build nCopy here in case msCopy changed */
      U32 *x = read->hit ;
      for (j = 0 ; j < read->nHit ; ++j, ++x)
	{ U32 y = *x & TOPMASK ;
	  ++read->nCopy[msCopy(rs->ms,y)] ;
	  if (ms->depth[y] < U16MAX) *rs->inv[y]++ = i ; /* this is the inverse map */
	}
    }
  offset = 0 ; /* now recreate rs->inv because we moved the pointers */
  for (i = 1 ; i <= ms->max ; ++i)
    if (ms->depth[i] && ms->depth[i] < U16MAX)
      { rs->inv[i] = rs->invSpace + offset ;
	offset += ms->depth[i] ;
      }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
movl 0x40(%r14), %edi
incl %edi
pushq $0x8
popq %rsi
callq 0x65c4
movq %rax, 0x18(%rbx)
movq 0x10(%rbx), %rdi
shlq $0x2, %rdi
callq 0x659c
movq %rax, 0x20(%rbx)
movl 0x40(%r14), %eax
pushq $0x1
popq %rcx
xorl %edx, %edx
cmpq %rax, %rcx
ja 0x17c6
movq 0x30(%r14), %rsi
movzwl (%rsi,%rcx,2), %esi
testl %esi, %esi
je 0x17c1
cmpl $0xffff, %esi           # imm = 0xFFFF
je 0x17c1
leaq (,%rdx,4), %rsi
addq 0x20(%rbx), %rsi
movq 0x18(%rbx), %rdi
movq %rsi, (%rdi,%rcx,8)
movq 0x30(%r14), %rsi
movzwl (%rsi,%rcx,2), %esi
addq %rsi, %rdx
incq %rcx
jmp 0x1789
movq 0x8(%rbx), %rsi
movslq 0x14(%rsi), %rax
addq 0x8(%rsi), %rax
pushq $0x1
popq %rcx
pushq $0x9
popq %rdx
cmpl 0x18(%rsi), %ecx
jae 0x1850
movq %rdx, %rsi
cmpq $0xd, %rsi
je 0x17ef
andl $0x0, (%rax,%rsi,4)
incq %rsi
jmp 0x17e0
movq 0x8(%rax), %rsi
xorl %edi, %edi
cmpl 0x4(%rax), %edi
jae 0x1844
movl (%rsi,%rdi,4), %r9d
movl %r9d, %r8d
andl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
movq (%rbx), %r10
movq 0x38(%r10), %r10
movzbl (%r10,%r8), %r10d
andl $0x3, %r10d
incl 0x24(%rax,%r10,4)
movq 0x30(%r14), %r10
addl %r9d, %r9d
cmpw $-0x1, (%r10,%r9)
je 0x183f
movq 0x18(%rbx), %r9
movq (%r9,%r8,8), %r10
leaq 0x4(%r10), %r11
movq %r11, (%r9,%r8,8)
movl %ecx, (%r10)
incq %rdi
jmp 0x17f5
incl %ecx
addq $0x48, %rax
movq 0x8(%rbx), %rsi
jmp 0x17d8
movl 0x40(%r14), %eax
pushq $0x1
popq %rcx
xorl %edx, %edx
cmpq %rax, %rcx
ja 0x1896
movq 0x30(%r14), %rsi
movzwl (%rsi,%rcx,2), %esi
testl %esi, %esi
je 0x1891
cmpl $0xffff, %esi           # imm = 0xFFFF
je 0x1891
leaq (,%rdx,4), %rsi
addq 0x20(%rbx), %rsi
movq 0x18(%rbx), %rdi
movq %rsi, (%rdi,%rcx,8)
movq 0x30(%r14), %rsi
movzwl (%rsi,%rcx,2), %esi
addq %rsi, %rdx
incq %rcx
jmp 0x1859
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/richarddurbin[P]hash10x/moshasm.c
// Function: badOverlaps
int badOverlaps (Readset *rs, Read *x)
{
  int i, nBad = 0 ;
  Array olap = findOverlaps (rs, x, 0) ;
  for (i = 0 ; i < arrayMax(olap) ; ++i) if (arrp(olap,i,Overlap)->isBad) ++nBad ;
  arrayDestroy (olap) ;
  return nBad ;
}

// Assembly:
pushq %rbx
xorl %ebx, %ebx
xorl %edx, %edx
callq 0x2142
movl 0x18(%rax), %ecx
testl %ecx, %ecx
cmovlel %ebx, %ecx
xorl %edx, %edx
cmpl %edx, %ecx
je 0x2935
movq 0x8(%rax), %rsi
movslq 0x14(%rax), %rdi
movslq %edx, %r8
imulq %rdi, %r8
cmpb $0x1, 0xd(%rsi,%r8)
sbbl $-0x1, %ebx
incl %edx
jmp 0x2915
movq %rax, %rdi
callq 0x5ea8
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/richarddurbin[P]hash10x/moshasm.c
// Function: markBadReads
void markBadReads (Readset *rs)
{
  int ix ;
  Read *x, *x0 = arrp(rs->reads,0,Read) ;

  for (ix = 0, x = x0 ; ix < arrayMax(rs->reads) ; ++ix, ++x)
    x->bad = 0 ; /* initialise by clearing all bad flags */
  
  /* first pass through findOverlaps - set badOrder10 */
  int nBad = 0 ;
  for (ix = 0, x = x0 ; ix < arrayMax(rs->reads) ; ++ix, ++x)
    if (badOverlaps (rs, x) >= 10) { x->badOrder10 = 1 ; ++nBad ; }
  printf ("MB  %d with >=10 bad overlaps\n", nBad) ;

  /* second pass, set badOrder1 for all 2 or more - will remove some more singleton errors */
  nBad = 0 ;
  for (ix = 0, x = x0 ; ix < arrayMax(rs->reads) ; ++ix, ++x)
    if (badOverlaps (rs, x) > 1 && !x->badOrder10) { x->badOrder1 = 1 ; ++nBad ; }
  printf ("MB  %d with multiple bad overlaps\n", nBad) ;

  /* third pass, set badOrder1 for anything bad  - must be simple pairs - might be too harsh */
  nBad = 0 ;
  for (ix = 0, x = x0 ; ix < arrayMax(rs->reads) ; ++ix, ++x)
    if (badOverlaps (rs, x) > 0 && !x->badOrder10) { x->badOrder1 = 1 ; ++nBad ; }
  printf ("MB  %d with single bad overlaps\n", nBad) ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdx
movq 0x8(%rdx), %r14
leaq 0x18(%r14), %rax
xorl %ecx, %ecx
movl 0x18(%rdx), %edx
cmpl %edx, %ecx
jge 0x2970
movb $0x0, (%rax)
incl %ecx
movq 0x8(%rbx), %rdx
addq $0x48, %rax
jmp 0x295a
xorl %r12d, %r12d
movq %r14, %r15
xorl %ebp, %ebp
cmpl %edx, %r12d
jge 0x29a4
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2901
cmpl $0xa, %eax
jl 0x2994
orb $0x2, 0x18(%r15)
incl %ebp
incl %r12d
addq $0x48, %r15
movq 0x8(%rbx), %rax
movl 0x18(%rax), %edx
jmp 0x2978
leaq 0x4a9e(%rip), %rdi      # 0x7449
xorl %r12d, %r12d
movl %ebp, %esi
xorl %eax, %eax
callq 0x10c0
movq %r14, %r15
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
cmpl 0x18(%rax), %r12d
jge 0x29ef
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2901
cmpl $0x2, %eax
jl 0x29e6
movb 0x18(%r15), %al
testb $0x2, %al
jne 0x29e6
orb $0x4, %al
movb %al, 0x18(%r15)
incl %ebp
incl %r12d
addq $0x48, %r15
jmp 0x29bc
leaq 0x4a72(%rip), %rdi      # 0x7468
xorl %r15d, %r15d
movl %ebp, %esi
xorl %eax, %eax
callq 0x10c0
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
cmpl 0x18(%rax), %r15d
jge 0x2a36
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2901
testl %eax, %eax
jle 0x2a2d
movb 0x18(%r14), %al
testb $0x2, %al
jne 0x2a2d
orb $0x4, %al
movb %al, 0x18(%r14)
incl %ebp
incl %r15d
addq $0x48, %r14
jmp 0x2a04
leaq 0x4a4e(%rip), %rdi      # 0x748b
movl %ebp, %esi
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x10c0
// File: /workspace/github_c_makefile_star2_O2/richarddurbin[P]hash10x/moshasm.c
// Function: markContained
void markContained (Readset *rs) 
{
  int ix, io ;
  Read *x, *x0 = arrp(rs->reads,0,Read) ;
  int nContained = 0, nNotContained = 0 ;
  U64 totLen = 0 ;
  Array overlaps = 0 ;
  
  for (ix = 0, x = x0 ; ix < arrayMax(rs->reads) ; ++ix, ++x)
    { if (overlaps) { arrayDestroy (overlaps) ; overlaps = 0 ; }
      if (x->bad) continue ;
      overlaps = findOverlaps (rs, x, 0) ;
      int maxHit = 0 ;
      for (io = 0 ; io < arrayMax (overlaps) ; ++io)
	{ Overlap *o = arrp(overlaps,io,Overlap) ;
	  if (o->iy == ix) continue ; /* don't allow self-containment! */
	  Read *y = arrp(rs->reads,o->iy,Read) ;
	  if (y->len < x->len || o->nHit <= maxHit) continue ;
	  if (o->isPlus && (o->offset > 0 || o->offset + y->len < x->len)) continue ;
	  if (!o->isPlus && (o->offset < x->len || o->offset - y->len > 0)) continue ;
	  x->contained = o->iy ; maxHit = o->nHit ;
	}
      if (x->contained) ++nContained ; else { ++nNotContained ; totLen += x->len ; }
    }
  printf ("MC  found %d contained reads, leaving %d not contained, av length %.1f\n",
	  nContained, nNotContained, nNotContained ? totLen/(double)nNotContained : 0.) ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rdi), %rax
movq 0x8(%rax), %r15
xorl %ebx, %ebx
xorl %ebp, %ebp
movq $0x0, (%rsp)
xorl %edi, %edi
xorl %r13d, %r13d
cmpl 0x18(%rax), %r13d
jge 0x2b4a
testq %rdi, %rdi
je 0x2a89
callq 0x5ea8
cmpb $0x0, 0x18(%r15)
je 0x2a97
xorl %edi, %edi
jmp 0x2b3a
xorl %r12d, %r12d
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2142
movq %rax, %rdi
movl 0x18(%rax), %eax
testl %eax, %eax
cmovlel %r12d, %eax
xorl %ecx, %ecx
cmpl %ecx, %eax
je 0x2b26
movq 0x8(%rdi), %r8
movslq 0x14(%rdi), %rdx
movslq %ecx, %r9
imulq %rdx, %r9
movl (%r8,%r9), %edx
cmpl %r13d, %edx
je 0x2b22
movq 0x8(%r14), %rsi
movq 0x8(%rsi), %r10
movl 0x14(%rsi), %esi
imull %edx, %esi
movl (%r10,%rsi), %r10d
movl (%r15), %r11d
cmpl %r11d, %r10d
jl 0x2b22
movl 0x4(%r8,%r9), %esi
cmpl %r12d, %esi
jle 0x2b22
cmpb $0x0, 0xc(%r8,%r9)
movl 0x8(%r8,%r9), %r8d
je 0x2b11
testl %r8d, %r8d
jg 0x2b22
addl %r10d, %r8d
cmpl %r11d, %r8d
jge 0x2b1b
jmp 0x2b22
cmpl %r11d, %r8d
jl 0x2b22
cmpl %r10d, %r8d
jg 0x2b22
movl %edx, 0x20(%r15)
movl %esi, %r12d
incl %ecx
jmp 0x2ab5
cmpl $0x0, 0x20(%r15)
je 0x2b31
incl %ebx
jmp 0x2b3a
incl %ebp
movslq (%r15), %rax
addq %rax, (%rsp)
incl %r13d
addq $0x48, %r15
movq 0x8(%r14), %rax
jmp 0x2a75
xorpd %xmm0, %xmm0
testl %ebp, %ebp
je 0x2b7a
movsd (%rsp), %xmm1
unpcklps 0x44b2(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x44ba(%rip), %xmm1     # 0x7020
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
cvtsi2sd %ebp, %xmm1
divsd %xmm1, %xmm0
leaq 0x492b(%rip), %rdi      # 0x74ac
movl %ebx, %esi
movl %ebp, %edx
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10c0
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/inject.c
// Function: join
static void join(pid_t pid, char *type) {
  char *path;
  int fd;

  path = string("/proc/%u/ns/%s", pid, type);

  if ((fd = open(path, O_RDONLY)) >= 0) {
    if (syscall(__NR_setns, fd, 0) < 0 && strcmp(type, "user") == 0)
      errx(EXIT_FAILURE, "Failed to join user namespace");
    close(fd);
  } else if (errno != ENOENT) {
    errx(EXIT_FAILURE, "PID %u does not belong to you", pid);
  } else if (strcmp(type, "user") == 0) {
    errx(EXIT_FAILURE, "PID %u not found or user namespace unavailable", pid);
  }

  free(path);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
leaq 0x18df(%rip), %rdi      # 0x4129
movl %ebp, %esi
movq %r14, %rdx
xorl %eax, %eax
callq 0x342b
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2290
testl %eax, %eax
js 0x289e
movl %eax, %r15d
movl $0x134, %edi            # imm = 0x134
movl %eax, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x21b0
testq %rax, %rax
jns 0x2894
leaq 0x17b8(%rip), %rsi      # 0x4040
movq %r14, %rdi
callq 0x2170
testl %eax, %eax
je 0x28e9
movl %r15d, %edi
callq 0x2140
jmp 0x28bb
callq 0x2050
cmpl $0x2, (%rax)
jne 0x28cd
leaq 0x1791(%rip), %rsi      # 0x4040
movq %r14, %rdi
callq 0x2170
testl %eax, %eax
je 0x28d6
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2040
leaq 0x1882(%rip), %rsi      # 0x4156
jmp 0x28dd
leaq 0x1897(%rip), %rsi      # 0x4174
pushq $0x1
popq %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2110
leaq 0x1848(%rip), %rsi      # 0x4138
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x2110
nop
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/map.c
// Function: denysetgroups
void denysetgroups(pid_t pid) {
  char *path, *text = "deny";
  int fd;

  path = string("/proc/%d/setgroups", pid);
  if ((fd = open(path, O_WRONLY)) < 0)
    errx(EXIT_FAILURE, "Failed to disable setgroups() in container");
  else if (write(fd, text, strlen(text)) != (ssize_t) strlen(text))
    errx(EXIT_FAILURE, "Failed to disable setgroups() in container");
  close(fd);
  free(path);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %esi
leaq 0x18ae(%rip), %rdi      # 0x41b6
xorl %eax, %eax
callq 0x342b
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
xorl %eax, %eax
callq 0x2290
testl %eax, %eax
js 0x2951
movl %eax, %ebp
leaq 0x1885(%rip), %rsi      # 0x41b1
pushq $0x4
popq %rdx
movl %eax, %edi
callq 0x2090
cmpq $0x4, %rax
jne 0x2951
movl %ebp, %edi
callq 0x2140
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2040
leaq 0x1871(%rip), %rsi      # 0x41c9
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/map.c
// Function: writemap
void writemap(pid_t pid, int type, char *map) {
  char *path, *range, *text = NULL;
  int fd;
  unsigned count, first, lower;

  if (!map) {
    map = (getuid() == 0 ? rootdefault : userdefault)(type);
  } else if (getuid() != 0) {
    range = readranges(type);
    verifymap(map, range);
    free(range);
  }

  while ((map = mapitem(map, &first, &lower, &count)))
    append(&text, "%u %u %u\n", first, lower, count);

  path = string("/proc/%d/%s", pid, idfile(type));
  if ((fd = open(path, O_WRONLY)) < 0)
    errx(EXIT_FAILURE, "Failed to set container %s map", idname(type));
  else if (write(fd, text, strlen(text)) != (ssize_t) strlen(text))
    errx(EXIT_FAILURE, "Failed to set container %s map", idname(type));

  close(fd);
  free(path);
  free(text);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movl %esi, %ebx
movl %edi, 0x20(%rsp)
andq $0x0, 0x18(%rsp)
callq 0x2100
testq %r14, %r14
movl %ebx, 0x24(%rsp)
je 0x29e2
testl %eax, %eax
je 0x29fd
movl %ebx, %edi
callq 0x2dd7
movq %rax, %r15
leaq 0x14(%rsp), %rbx
leaq 0xc(%rsp), %r12
leaq 0x10(%rsp), %r13
movq %r14, %rbp
movq %rbp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x2fbb
testq %rax, %rax
je 0x29d8
movq %rax, %rbp
movl 0xc(%rsp), %esi
movl 0x10(%rsp), %edx
movq %r15, %rdi
callq 0x31c6
jmp 0x29ad
movq %r15, %rdi
callq 0x2040
jmp 0x29fd
testl %eax, %eax
leaq 0x11b(%rip), %rax       # 0x2b06
leaq 0x289(%rip), %rcx       # 0x2c7b
cmoveq %rax, %rcx
movl %ebx, %edi
callq *%rcx
movq %rax, %r14
leaq 0x14(%rsp), %r15
leaq 0xc(%rsp), %r12
leaq 0x10(%rsp), %r13
leaq 0x17e1(%rip), %rbp      # 0x41f4
leaq 0x18(%rsp), %rbx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x2fbb
testq %rax, %rax
je 0x2a4d
movq %rax, %r14
movl 0x14(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %r8d
movq %rbx, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3258
jmp 0x2a18
movl 0x24(%rsp), %ebp
testl %ebp, %ebp
leaq 0x17b0(%rip), %rax      # 0x420a
leaq 0x17b1(%rip), %rdx      # 0x4212
cmoveq %rax, %rdx
leaq 0x1792(%rip), %rdi      # 0x41fe
movl 0x20(%rsp), %esi
xorl %eax, %eax
callq 0x342b
movq %rax, %r14
pushq $0x1
popq %rsi
movq %rax, %rdi
xorl %eax, %eax
callq 0x2290
testl %eax, %eax
js 0x2ae1
movl %eax, %ebx
movq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x20e0
movl %ebx, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2090
movq %rax, %r15
movq 0x18(%rsp), %rdi
callq 0x20e0
cmpq %rax, %r15
jne 0x2ae1
movl %ebx, %edi
callq 0x2140
movq %r14, %rdi
callq 0x2040
movq 0x18(%rsp), %rdi
callq 0x2040
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %ebp, %ebp
leaq 0x174f(%rip), %rax      # 0x4239
leaq 0x174c(%rip), %rdx      # 0x423d
cmoveq %rax, %rdx
leaq 0x171e(%rip), %rsi      # 0x421a
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/map.c
// Function: rootdefault
static char *rootdefault(int type) {
  char *cursor, *map, *result;
  unsigned count, first, last = INVALID, lower;

  cursor = map = getmap(-1, type);
  while ((cursor = mapitem(cursor, &first, &lower, &count)))
    if (last == INVALID || last < first + count - 1)
      last = first + count - 1;
  result = string("0:%u:1", last);

  cursor = map;
  while ((cursor = mapitem(cursor, &first, &lower, &count))) {
    if (first == 0) {
      if (count == 1 && first >= last)
        errx(EXIT_FAILURE, "No unprivileged %s available\n", idname(type));
      first++, lower++, count--;
    }

    if (last <= first + count - 1 && count > 0)
      count--;

    if (count > 0)
      append(&result, "%s%u:%u:%u", result ? "," : "", first, first, count);
  }

  free(map);
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, 0x1c(%rsp)
callq 0x3026
pushq $-0x1
popq %rbp
leaq 0x8(%rsp), %rbx
leaq 0xc(%rsp), %r14
leaq 0x4(%rsp), %r15
movq %rax, 0x20(%rsp)
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x2fbb
testq %rax, %rax
je 0x2b67
movl 0x8(%rsp), %ecx
movl 0x4(%rsp), %edx
addl %edx, %ecx
decl %ecx
cmpl %ecx, %ebp
movl %ecx, %edx
cmoval %ebp, %edx
cmpl $-0x1, %ebp
cmovel %ecx, %edx
movl %edx, %ebp
jmp 0x2b34
leaq 0x16d3(%rip), %rdi      # 0x4241
movl %ebp, %esi
xorl %eax, %eax
callq 0x342b
leaq 0x10(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x8(%rsp), %r12
leaq 0xc(%rsp), %r13
leaq 0x4(%rsp), %rbx
leaq 0x16d1(%rip), %r14      # 0x4266
movq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x2fbb
testq %rax, %rax
je 0x2c35
movq %rax, %r15
movl 0x8(%rsp), %ecx
movl 0x4(%rsp), %r9d
testl %ecx, %ecx
jne 0x2beb
cmpl $0x1, %r9d
jne 0x2bd2
testl %ebp, %ebp
je 0x2c53
incl 0xc(%rsp)
movl $0x1, 0x8(%rsp)
decl %r9d
movl %r9d, 0x4(%rsp)
pushq $0x1
popq %rax
movl %eax, %ecx
movl %r9d, %eax
addl $-0x1, %eax
jae 0x2c01
leal (%rax,%rcx), %edx
cmpl %edx, %ebp
ja 0x2c01
movl %eax, 0x4(%rsp)
movl %eax, %r9d
testl %r9d, %r9d
je 0x2b9a
cmpq $0x0, 0x10(%rsp)
leaq 0x165e(%rip), %rdx      # 0x4271
leaq 0x150e(%rip), %rax      # 0x4128
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movl %ecx, %r8d
xorl %eax, %eax
callq 0x3258
jmp 0x2b9a
movq 0x20(%rsp), %rdi
callq 0x2040
movq 0x10(%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x1c(%rsp)
leaq 0x15da(%rip), %rax      # 0x4239
leaq 0x15d7(%rip), %rdx      # 0x423d
cmoveq %rax, %rdx
leaq 0x15d7(%rip), %rsi      # 0x4248
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/map.c
// Function: userdefault
static char *userdefault(int type) {
  char *cursor, *map, *range, *result = NULL;
  unsigned count, first, index = 0, length, lower, start;

  if (geteuid() != 0)
    return string("0:%u:1", getid(type));

  map = getmap(-1, type);
  range = readranges(type);

  while ((range = rangeitem(range, &start, &length))) {
    cursor = map;
    while ((cursor = mapitem(cursor, &first, &lower, &count))) {
      if (start + length <= first || first + count <= start)
        continue;
      if (first + count < start + length)
        length = start - first + count;
      if (start < first) {
        index += first - start;
        length -= first - start;
        start = first;
      }
      append(&result, "%s%u:%u:%u", result ? "," : "", index, start, length);
      index += length;
    }
  }

  free(map);
  free(range);
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, %ebx
andq $0x0, 0x8(%rsp)
callq 0x2130
testl %eax, %eax
je 0x2cac
testl %ebx, %ebx
je 0x2db4
callq 0x2100
jmp 0x2db9
movl %ebx, %edi
callq 0x3026
movq %rax, 0x18(%rsp)
movl %ebx, %edi
callq 0x2dd7
movq %rax, %r13
leaq 0x10(%rsp), %r12
leaq 0x24(%rsp), %rbp
leaq 0x14(%rsp), %r14
xorl %r15d, %r15d
movq %r13, %rdi
leaq 0x4(%rsp), %rsi
movq %rsp, %rdx
callq 0x315e
testq %rax, %rax
je 0x2d96
movq %rax, %r13
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x2fbb
testq %rax, %rax
je 0x2cd4
movq %rax, %rbx
movl 0x4(%rsp), %eax
movl (%rsp), %r9d
leal (%r9,%rax), %edx
movl 0x10(%rsp), %r8d
cmpl %r8d, %edx
jbe 0x2cf5
movl 0x14(%rsp), %ecx
leal (%rcx,%r8), %esi
cmpl %eax, %esi
jbe 0x2cf5
cmpl %edx, %esi
jae 0x2d41
movl %eax, %r9d
subl %r8d, %r9d
addl %ecx, %r9d
movl %r9d, (%rsp)
cmpl %r8d, %eax
jae 0x2d5c
movl %r8d, %ecx
subl %eax, %ecx
addl %ecx, %r15d
subl %ecx, %r9d
movl %r9d, (%rsp)
movl %r8d, 0x4(%rsp)
jmp 0x2d5f
movl %eax, %r8d
cmpq $0x0, 0x8(%rsp)
leaq 0x1505(%rip), %rdx      # 0x4271
leaq 0x13b5(%rip), %rax      # 0x4128
cmoveq %rax, %rdx
leaq 0x8(%rsp), %rdi
leaq 0x14e3(%rip), %rsi      # 0x4266
movl %r15d, %ecx
xorl %eax, %eax
callq 0x3258
addl (%rsp), %r15d
jmp 0x2cf5
movq 0x18(%rsp), %rdi
callq 0x2040
movq 0x8(%rsp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x21d0
leaq 0x1481(%rip), %rdi      # 0x4241
movl %eax, %esi
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x342b
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/map.c
// Function: mapitem
static char *mapitem(char *map, unsigned *first, unsigned *lower,
    unsigned *count) {
  ssize_t skip;

  while (map && *map && strchr(",;", *map))
    map++;
  if (map == NULL || *map == '\0')
    return NULL;
  if (sscanf(map, "%u:%u:%u%zn", first, lower, count, &skip) < 3)
    errx(EXIT_FAILURE, "Invalid ID map '%s'", map);
  return map + skip;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r8
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
xorl %eax, %eax
testq %rbx, %rbx
je 0x300c
movzbl (%rbx), %esi
cmpl $0x2c, %esi
je 0x2fe0
cmpl $0x3b, %esi
jne 0x2fe5
incq %rbx
jmp 0x2fce
testl %esi, %esi
je 0x300c
leaq 0x1356(%rip), %rsi      # 0x4346
leaq 0x8(%rsp), %r9
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2200
cmpl $0x2, %eax
jle 0x3012
addq 0x8(%rsp), %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
leaq 0x1339(%rip), %rsi      # 0x4352
pushq $0x1
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/map.c
// Function: getmap
static char *getmap(pid_t pid, int type) {
  char *line = NULL, *result = NULL, *path;
  size_t size;
  unsigned count, first, lower;
  FILE *file;

  if (pid == -1)
    path = string("/proc/self/%s", idfile(type));
  else
    path = string("/proc/%d/%s", pid, idfile(type));
  if (!(file = fopen(path, "r")))
    errx(EXIT_FAILURE, "Cannot read %s", path);

  while (getline(&line, &size, file) >= 0) {
    if (sscanf(line, " %u %u %u", &first, &lower, &count) != 3)
      errx(EXIT_FAILURE, "Invalid map data in %s", path);
    append(&result, "%s%u:%u:%u", result ? "," : "", first, lower, count);
  }

  if (!result)
    errx(EXIT_FAILURE, "Invalid map data in %s", path);

  fclose(file);
  free(line);
  free(path);
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
andq $0x0, 0x18(%rsp)
andq $0x0, 0x10(%rsp)
testl %edi, %edi
leaq 0x11c1(%rip), %rax      # 0x420a
leaq 0x11c2(%rip), %rsi      # 0x4212
cmoveq %rax, %rsi
leaq 0x1218(%rip), %rdi      # 0x4273
xorl %eax, %eax
callq 0x342b
leaq 0x1189(%rip), %rsi      # 0x41f2
movq %rax, 0x8(%rsp)
movq %rax, %rdi
callq 0x22a0
testq %rax, %rax
je 0x3155
movq %rax, %r14
leaq 0x2c(%rsp), %r13
leaq 0x109a(%rip), %rbp      # 0x4128
leaq 0x11dc(%rip), %rbx      # 0x4271
leaq 0x11ca(%rip), %r15      # 0x4266
leaq 0x10(%rsp), %r12
leaq 0x18(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %r14, %rdx
callq 0x22c0
testq %rax, %rax
js 0x3107
movq 0x18(%rsp), %rdi
leaq 0x11cc(%rip), %rsi      # 0x4290
leaq 0x28(%rsp), %rdx
leaq 0x24(%rsp), %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x2200
cmpl $0x3, %eax
jne 0x313f
cmpq $0x0, 0x10(%rsp)
movq %rbx, %rdx
cmoveq %rbp, %rdx
movl 0x28(%rsp), %ecx
movl 0x24(%rsp), %r8d
movl 0x2c(%rsp), %r9d
movq %r12, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x3258
jmp 0x30a1
cmpq $0x0, 0x10(%rsp)
je 0x313f
movq %r14, %rdi
callq 0x20b0
movq 0x18(%rsp), %rdi
callq 0x2040
movq 0x8(%rsp), %rdi
callq 0x2040
movq 0x10(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1154(%rip), %rsi      # 0x429a
pushq $0x1
popq %rdi
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x2110
leaq 0x1125(%rip), %rsi      # 0x4281
jmp 0x3146
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/map.c
// Function: rangeitem
static char *rangeitem(char *range, unsigned *start, unsigned *length) {
  ssize_t skip;

  while (range && *range && strchr(",;", *range))
    range++;
  if (range == NULL || *range == '\0')
    return NULL;
  if (sscanf(range, "%u:%u%zn", start, length, &skip) < 2)
    errx(EXIT_FAILURE, "Invalid ID range '%s'", range);
  return range + skip;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
xorl %eax, %eax
testq %rbx, %rbx
je 0x31ac
movzbl (%rbx), %esi
cmpl $0x2c, %esi
je 0x3180
cmpl $0x3b, %esi
jne 0x3185
incq %rbx
jmp 0x316e
testl %esi, %esi
je 0x31ac
leaq 0x11b9(%rip), %rsi      # 0x4349
leaq 0x8(%rsp), %r8
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2200
cmpl $0x1, %eax
jle 0x31b2
addq 0x8(%rsp), %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
leaq 0x10f8(%rip), %rsi      # 0x42b1
pushq $0x1
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/map.c
// Function: validate
static void validate(char *range, unsigned first, unsigned count) {
  unsigned length, start;

  while ((range = rangeitem(range, &start, &length)))
    if (first < start + length && start < first + count) {
      if (first < start)
        validate(range, first, start - first);
      if (first + count > start + length)
        validate(range, start + length, first + count - start - length);
      return;
    }
  errx(EXIT_FAILURE, "Cannot map onto IDs that are not delegated to you");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
addl %esi, %ebx
leaq 0x8(%rsp), %r15
leaq 0xc(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x315e
testq %rax, %rax
je 0x3244
movq %rax, %r14
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %esi
addl %edx, %esi
cmpl %ebp, %esi
setbe %al
cmpl %ebx, %edx
setae %cl
orb %al, %cl
jne 0x31e5
subl %ebp, %edx
jbe 0x3229
movq %r14, %rdi
movl %ebp, %esi
callq 0x31c6
movl 0xc(%rsp), %esi
addl 0x8(%rsp), %esi
subl %esi, %ebx
jbe 0x3237
movq %r14, %rdi
movl %ebx, %edx
callq 0x31c6
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10c9(%rip), %rsi      # 0x4314
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x2110
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/util.c
// Function: append
char *append(char **destination, const char *format, ...) {
  char *extra, *result;
  va_list args;

  va_start(args, format);
  if (vasprintf(&extra, format, args) < 0)
    err(EXIT_FAILURE, "asprintf");
  va_end(args);

  if (*destination == NULL) {
    *destination = extra;
    return extra;
  }

  if (asprintf(&result, "%s%s", *destination, extra) < 0)
      err(EXIT_FAILURE, "asprintf");
  free(*destination);
  free(extra);
  *destination = result;
  return result;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x32b8
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
leaq 0x10(%rsp), %rdx
movq %rdi, 0x10(%rdx)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq %rsp, %r14
movq %r14, %rdi
callq 0x20a0
testl %eax, %eax
js 0x3331
movq (%rbx), %rdx
testq %rdx, %rdx
je 0x3320
movq (%rsp), %rcx
leaq 0x1073(%rip), %rsi      # 0x436f
leaq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2250
testl %eax, %eax
js 0x3331
movq (%rbx), %rdi
callq 0x2040
movq (%rsp), %rdi
callq 0x2040
movq (%r14), %rax
movq %rax, (%rbx)
addq $0xe8, %rsp
popq %rbx
popq %r14
retq
leaq 0x102e(%rip), %rsi      # 0x4366
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/util.c
// Function: seal
void seal(char **argv, char **envp) {
  const int seals = F_SEAL_SEAL | F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE;
  int dst, src;
  ssize_t length;

  if ((src = open("/proc/self/exe", O_RDONLY)) < 0)
    err(EXIT_FAILURE, "open /proc/self/exe");
  if (fcntl(src, F_GET_SEALS) == seals) {
    close(src);
    return;
  }

  dst = memfd_create("/proc/self/exe", MFD_CLOEXEC | MFD_ALLOW_SEALING);
  if (dst < 0)
    err(EXIT_FAILURE, "memfd_create");

  while (length = sendfile(dst, src, NULL, BUFSIZ), length != 0)
    if (length < 0 && errno != EAGAIN && errno != EINTR)
      err(EXIT_FAILURE, "sendfile");
  close(src);

  if (fcntl(dst, F_ADD_SEALS, seals) < 0)
    err(EXIT_FAILURE, "fcntl F_ADD_SEALS");
  fexecve(dst, argv, envp);
  err(EXIT_FAILURE, "fexecve");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1023(%rip), %rdi      # 0x4379
xorl %esi, %esi
xorl %eax, %eax
callq 0x2290
testl %eax, %eax
js 0x3389
movl %eax, %ebp
movl %eax, %edi
movl $0x40a, %esi            # imm = 0x40A
xorl %eax, %eax
callq 0x2080
cmpl $0xf, %eax
jne 0x3395
movl %ebp, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2140
leaq 0xfe4(%rip), %rsi       # 0x4374
jmp 0x3421
leaq 0xfdd(%rip), %rdi       # 0x4379
pushq $0x3
popq %rsi
callq 0x2060
testl %eax, %eax
jns 0x33b1
leaq 0xfd9(%rip), %rsi       # 0x4388
jmp 0x3421
movl %eax, %r15d
movl $0x2000, %ecx           # imm = 0x2000
movl %r15d, %edi
movl %ebp, %esi
xorl %edx, %edx
callq 0x2240
testq %rax, %rax
je 0x33e6
jns 0x33b4
callq 0x2050
movl (%rax), %eax
cmpl $0x4, %eax
je 0x33b4
cmpl $0xb, %eax
je 0x33b4
leaq 0xfb1(%rip), %rsi       # 0x4395
jmp 0x3421
movl %ebp, %edi
callq 0x2140
pushq $0xf
popq %rdx
movl %r15d, %edi
movl $0x409, %esi            # imm = 0x409
xorl %eax, %eax
callq 0x2080
testl %eax, %eax
jns 0x340c
leaq 0xf94(%rip), %rsi       # 0x439e
jmp 0x3421
movl %r15d, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2190
leaq 0xf8f(%rip), %rsi       # 0x43b0
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/util.c
// Function: string
char *string(const char *format, ...) {
  char *result;
  va_list args;

  va_start(args, format);
  if (vasprintf(&result, format, args) < 0)
    err(EXIT_FAILURE, "asprintf");
  va_end(args);
  return result;
}

// Assembly:
subq $0xe8, %rsp
movq %rdi, %r10
leaq 0x30(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x348c
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
leaq 0x10(%rsp), %rdx
movq %rdi, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
leaq 0x8(%rsp), %rdi
movq %r10, %rsi
callq 0x20a0
testl %eax, %eax
js 0x34cc
movq 0x8(%rsp), %rax
addq $0xe8, %rsp
retq
leaq 0xe93(%rip), %rsi       # 0x4366
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/util.c
// Function: tmpdir
char *tmpdir(void) {
  char *dir;

  if (!(dir = strdup("/tmp/XXXXXX")))
    err(EXIT_FAILURE, "strdup");
  else if (!mkdtemp(dir))
    errx(EXIT_FAILURE, "Failed to create temporary directory");
  return dir;
}

// Assembly:
pushq %rbx
leaq 0xed3(%rip), %rdi       # 0x43b8
callq 0x22f0
testq %rax, %rax
je 0x3504
movq %rax, %rbx
movq %rax, %rdi
callq 0x2260
testq %rax, %rax
je 0x3515
movq %rbx, %rax
popq %rbx
retq
leaq 0xeb9(%rip), %rsi       # 0x43c4
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x21f0
leaq 0xeaf(%rip), %rsi       # 0x43cb
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x2110
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/util.c
// Function: waitforexit
void waitforexit(pid_t child) {
  int status;

  if (waitpid(child, &status, 0) < 0)
    err(EXIT_FAILURE, "waitpid");
  else if (WEXITSTATUS(status) != EXIT_SUCCESS)
    exit(WEXITSTATUS(status));
}

// Assembly:
pushq %rax
leaq 0x4(%rsp), %rsi
xorl %edx, %edx
callq 0x2280
testl %eax, %eax
js 0x3542
movzbl 0x5(%rsp), %edi
testl %edi, %edi
jne 0x3553
popq %rax
retq
leaq 0xea7(%rip), %rsi       # 0x43f0
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x21f0
callq 0x22d0
// File: /workspace/github_c_makefile_star2_O2/arachsys[P]containers/util.c
// Function: waitforstop
void waitforstop(pid_t child) {
  int status;

  if (waitpid(child, &status, WUNTRACED) < 0)
    err(EXIT_FAILURE, "waitpid");
  if (!WIFSTOPPED(status))
    exit(WEXITSTATUS(status));
}

// Assembly:
pushq %rax
leaq 0x4(%rsp), %rsi
pushq $0x2
popq %rdx
callq 0x2280
testl %eax, %eax
js 0x3574
movl 0x4(%rsp), %eax
cmpb $0x7f, %al
jne 0x3585
popq %rax
retq
leaq 0xe75(%rip), %rsi       # 0x43f0
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x21f0
movzbl %ah, %edi
callq 0x22d0
// File: /workspace/github_c_makefile_star2_O2/generot[P]VM-0/src/vm/entry.c
// Function: stack_push
bool stack_push(double val) {
    if(stack_ptr >= stack_sz) {
        ISSUE_ERROR("Stack overflow. Maximum segment size reached(%I64d)", 
            stack_sz);
    }

    code_seg[stack_ptr++] = val;
    return true;
}

// Assembly:
movq 0x2dd5(%rip), %rax      # 0x40a0
movq 0x2dc6(%rip), %rdx      # 0x4098
cmpq %rdx, %rax
jge 0x12f2
movq 0x2daa(%rip), %rcx      # 0x4088
leaq 0x1(%rax), %rdx
movq %rdx, 0x2db7(%rip)      # 0x40a0
movsd %xmm0, (%rcx,%rax,8)
pushq $0x1
popq %rax
retq
pushq %rax
movq 0x2cfe(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xd06(%rip), %rsi       # 0x200a
xorl %eax, %eax
callq 0x1080
pushq $-0x1
popq %rdi
callq 0x10b0
// File: /workspace/github_c_makefile_star2_O2/generot[P]VM-0/src/vm/entry.c
// Function: stack_pop
double stack_pop(void) {
    if(stack_ptr <= 0) {
        ISSUE_ERROR("Stack underflow. Out of bounds(stack pointer: %I64d).", stack_ptr);
    }

    double ret_val = code_seg[--stack_ptr];
    code_seg[stack_ptr] = 0;

    return ret_val;
}

// Assembly:
movq 0x2d86(%rip), %rdx      # 0x40a0
testq %rdx, %rdx
jle 0x133e
movq 0x2d62(%rip), %rax      # 0x4088
leaq -0x1(%rdx), %rcx
movq %rcx, 0x2d6f(%rip)      # 0x40a0
movsd -0x8(%rax,%rdx,8), %xmm0
andq $0x0, -0x8(%rax,%rdx,8)
retq
pushq %rax
movq 0x2cb2(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xcef(%rip), %rsi       # 0x203f
xorl %eax, %eax
callq 0x1080
pushq $-0x1
popq %rdi
callq 0x10b0
// File: /workspace/github_c_makefile_star2_O2/generot[P]VM-0/src/vm/entry.c
// Function: main
int main(int argc, char **argv) {
    if(argc < 2) ISSUE_ERROR("Usage: ./vm <bytecode_file>");

    bcode_file bcode = read_bytecode(argv[1]);

    bool stack_size_specified = bcode.metadata.stack_size_spec == STACK_SIZE_SPECIFIED;

    size_t mem_sz = stack_size_specified
                    ? bcode.metadata.code_seg_sz + bcode.metadata.data_seg_sz
                    : DEFAULT_STACK_SIZE; 

    memory = calloc(mem_sz, sizeof(double));

    stack_sz = stack_size_specified
               ? bcode.metadata.code_seg_sz
               : CODE_SEG_SZ;

    data_seg = memory;
    code_seg = &memory[stack_size_specified ? bcode.metadata.data_seg_sz : DATA_SEG_SZ];

    size_s entry_point_addr = (size_s)bcode.metadata.entry_point_addr;
    size_s prog_sz = (size_s)bcode.metadata.program_size;
    
    for(size_s i = entry_point_addr; i < prog_sz; i++) {
        handle_instr(bcode.prog[i], data_seg, &i);
    }

    free(memory);
    free(bcode.prog);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
cmpl $0x1, %edi
jle 0x1444
movq 0x8(%rsi), %rsi
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x1246
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
cmpl $0x0, 0x18(%rbx)
leaq (%rcx,%rax), %rdx
movl $0x800, %edi            # imm = 0x800
cmoveq %rdx, %rdi
movl $0x200, %r14d           # imm = 0x200
cmoveq %rax, %r14
movl $0x600, %r15d           # imm = 0x600
cmoveq %rcx, %r15
pushq $0x8
popq %rsi
callq 0x1070
movq %rax, 0x2cc2(%rip)      # 0x4080
movq %r14, 0x2cd3(%rip)      # 0x4098
movq %rax, 0x2cc4(%rip)      # 0x4090
leaq (%rax,%r15,8), %rax
movq %rax, 0x2cb1(%rip)      # 0x4088
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %rax
leaq 0x18(%rsp), %rbx
movq %rax, 0x18(%rsp)
cmpq %r14, %rax
jge 0x1422
movq 0x20(%rsp), %rcx
imulq $0x18, %rax, %rax
movq 0x2c92(%rip), %rdi      # 0x4090
movq 0x10(%rcx,%rax), %rdx
movq %rdx, 0x10(%rsp)
movups (%rcx,%rax), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rsi
callq 0x1468
movq 0x18(%rsp), %rax
incq %rax
jmp 0x13e4
movq 0x2c57(%rip), %rdi      # 0x4080
callq 0x1030
movq 0x20(%rsp), %rdi
callq 0x1030
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x2bad(%rip), %rax      # 0x3ff8
movq (%rax), %rcx
leaq 0xc21(%rip), %rdi       # 0x2076
pushq $0x1c
popq %rsi
pushq $0x1
popq %rdx
callq 0x10c0
pushq $-0x1
popq %rdi
callq 0x10b0
// File: /workspace/github_c_makefile_star2_O2/generot[P]VM-0/src/vm/handling.c
// Function: handle_syscall
void handle_syscall(instr in, double *data_segment) {
    switch(in.scall) {
    case SC_READ:
        scanf("%lf", &data_segment[in.addr]);
        break;
    case SC_WRITE:
        printf("%lf", stack_pop());
        break;
    case SC_WRITELN:
        printf("%lf\n", stack_pop());
        break;
    }
}

// Assembly:
pushq %rax
movl 0x18(%rsp), %eax
testl %eax, %eax
je 0x168f
cmpl $0x1, %eax
je 0x1681
cmpl $0x2, %eax
jne 0x16a3
leaq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
leaq (%rdi,%rax,8), %rsi
leaq 0xa7f(%rip), %rdi       # 0x20f8
xorl %eax, %eax
popq %rcx
jmp 0x10a0
callq 0x1313
leaq 0xa6f(%rip), %rdi       # 0x20fc
jmp 0x169b
callq 0x1313
leaq 0xa5d(%rip), %rdi       # 0x20f8
movb $0x1, %al
popq %rcx
jmp 0x1060
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/openshmem-org[P]openshmem-examples/c/arrput.c
// Function: main
int
main(void)
{
    int i;
    int nextpe;
    int me, npes;
    long src[N];
    long *dest;
    struct utsname u;
    int su;

    su = uname(&u);
    assert(su == 0);

    shmem_init();
    me = shmem_my_pe();
    npes = shmem_n_pes();

    for (i = 0; i < N; i += 1) {
        src[i] = (long) me;
    }

    dest = (long *) shmem_malloc(N * sizeof(*dest));

    nextpe = (me + 1) % npes;

    shmem_long_put(dest, src, N, nextpe);

    shmem_barrier_all();

    for (i = 0; i < N; i += 1) {
        printf("%d @ %s: dest[%d] = %ld\n", me, u.nodename, i, dest[i]);
    }

    shmem_free(dest);

    shmem_finalize();

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
leaq 0x42(%rsp), %rdi
callq 0x1050
testl %eax, %eax
jne 0x12a0
callq 0x10c0
callq 0x1090
movl %eax, %ebx
callq 0x1070
movl %eax, %ebp
movslq %ebx, %rax
xorl %ecx, %ecx
cmpq $0x7, %rcx
je 0x1226
movq %rax, (%rsp,%rcx,8)
incq %rcx
jmp 0x1217
pushq $0x38
popq %rdi
callq 0x10a0
movq %rax, %r14
leal 0x1(%rbx), %eax
cltd
idivl %ebp
movl %edx, %ecx
movq %rsp, %rsi
pushq $0x7
popq %rdx
movq %r14, %rdi
callq 0x1040
callq 0x10b0
leaq 0x83(%rsp), %r15
leaq 0xdc9(%rip), %r12       # 0x2024
xorl %r13d, %r13d
cmpq $0x7, %r13
je 0x127f
movq (%r14,%r13,8), %r8
movq %r12, %rdi
movl %ebx, %esi
movq %r15, %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x1030
incq %r13
jmp 0x125e
movq %r14, %rdi
callq 0x10d0
callq 0x1080
xorl %eax, %eax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd5d(%rip), %rdi       # 0x2004
leaq 0xd5e(%rip), %rsi       # 0x200c
leaq 0xd60(%rip), %rcx       # 0x2015
pushq $0x4a
popq %rdx
callq 0x1060
// File: /workspace/github_c_makefile_star2_O2/motet-a[P]libforks/tests/basic_pipe.c
// Function: main
int main() {
  libforks_ServerConn conn;

  main_process_pid = getpid();

  check(pipe(pipe_fds) == 0);

  check(libforks_start(&conn) == libforks_OK);

  check(close(pipe_fds[1]) == 0);

  check(libforks_fork(
    conn,
    NULL, // pid_ptr
    NULL, // socket_fd_ptr
    NULL, // exit_fd_ptr
    child_main
  ) == libforks_OK);

  // Make sure that we can read one and only one char written by the
  // child process
  char buffer[16];
  check(read(pipe_fds[0], buffer, sizeof buffer) == 1);
  check(buffer[0] == 'a');

  check(libforks_stop(conn) == libforks_OK);

  return 0;
}

// Assembly:
subq $0x28, %rsp
callq 0x1090
movl %eax, 0x4e11(%rip)      # 0x610c
leaq 0x4e0e(%rip), %rdi      # 0x6110
callq 0x10e0
testl %eax, %eax
jne 0x1378
leaq 0x8(%rsp), %rdi
callq 0x17d2
testl %eax, %eax
jne 0x1383
movl 0x4df5(%rip), %edi      # 0x6114
callq 0x10c0
testl %eax, %eax
jne 0x138e
movq 0x8(%rsp), %rdi
leaq 0xc0(%rip), %r8         # 0x13f4
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x20ce
testl %eax, %eax
jne 0x1399
movl 0x4dc7(%rip), %edi      # 0x6110
leaq 0x10(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x10f0
cmpq $0x1, %rax
jne 0x13a4
cmpb $0x61, 0x10(%rsp)
jne 0x13af
movq 0x8(%rsp), %rdi
callq 0x2272
testl %eax, %eax
jne 0x13ba
xorl %eax, %eax
addq $0x28, %rsp
retq
leaq 0x1c85(%rip), %rdi      # 0x3004
pushq $0x13
jmp 0x13c3
leaq 0x1ca1(%rip), %rdi      # 0x302b
pushq $0x15
jmp 0x13c3
leaq 0x1cbb(%rip), %rdi      # 0x3050
pushq $0x17
jmp 0x13c3
leaq 0x1cc8(%rip), %rdi      # 0x3068
pushq $0x1f
jmp 0x13c3
leaq 0x1d00(%rip), %rdi      # 0x30ab
pushq $0x24
jmp 0x13c3
leaq 0x1d23(%rip), %rdi      # 0x30d9
pushq $0x25
jmp 0x13c3
leaq 0x1d29(%rip), %rdi      # 0x30ea
pushq $0x27
popq %rsi
callq 0x13c9