LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/jrrk[P]cbzone/c_gpr.c
// Function: waitforkey
void waitforkey(c)
     char c;
{
  char keystr;
  XEvent ev;

  XFlush(d);                    /* out with the old */
  while (XPending(d))
    XNextEvent(d, &ev);
                                /* now wait for the new */
  while (1) {
    XWindowEvent(d, w, KeyPressMask|ButtonPressMask, &ev);
    switch(ev.type) {
    case KeyPress:
      if (!c || XLookupString(&ev.xkey,&keystr,1,(KeySym *) 0,
                        (XComposeStatus *) 0) == 1 &&
          keystr == c)
        return;
      break;
    case ButtonPress:
      if (!c)
        return;
      break;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movl %edi, %ebx
movq 0xcdd9(%rip), %rdi      # 0x14638
callq 0x4400
movq 0xcdcd(%rip), %rdi      # 0x14638
callq 0x45c0
testl %eax, %eax
je 0x7898
leaq 0x8(%rsp), %r14
movq 0xcdb8(%rip), %rdi      # 0x14638
movq %r14, %rsi
callq 0x4340
movq 0xcda9(%rip), %rdi      # 0x14638
callq 0x45c0
testl %eax, %eax
jne 0x7879
movsbl %bl, %ebp
leaq 0x8(%rsp), %r14
leaq 0x7(%rsp), %r15
movq 0xcd8c(%rip), %rdi      # 0x14638
movq 0xcd8d(%rip), %rsi      # 0x14640
movl $0x5, %edx
movq %r14, %rcx
callq 0x4350
movl 0x8(%rsp), %eax
cmpl $0x4, %eax
je 0x78f7
cmpl $0x2, %eax
jne 0x78a5
testb %bl, %bl
je 0x78fb
movq %r14, %rdi
movq %r15, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x40e0
cmpl $0x1, %eax
jne 0x78a5
movsbl 0x7(%rsp), %eax
cmpl %eax, %ebp
jne 0x78a5
jmp 0x78fb
testb %bl, %bl
jne 0x78a5
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/jrrk[P]cbzone/c_graphics.c
// Function: message
void message(number, bell)
     int number;
     Bool bell;
{
  static int xpt = 70;
  static int ypt[] = {507, 567, 627};
  static char* messages[] = {"ENEMY TANK IN FIRING ARC",
                               "MOVEMENT BLOCKED BY OBJECT",
                               "SALVO FIRED BY ENEMY TANK"};
  int ind;
  char text[41];

  ind = abs(number) - 1;
  if (number < 0)
    sprintf(text,"%-40s"," ");
  else
    sprintf(text,"%-40s",messages[ind]);

  gprsetclippingactive(False);
  printstring(xpt, ypt[ind], text, 40);
  gprsetclippingactive(True);
  if (bell)
    tonetime();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movl %edi, %eax
negl %eax
cmovsl %edi, %eax
movl %esi, %ebx
decl %eax
movslq %eax, %r14
testl %edi, %edi
js 0x7a74
leaq 0x6c28(%rip), %rax      # 0xe68c
movslq (%rax,%r14,4), %rdx
addq %rax, %rdx
leaq 0x6edc(%rip), %rsi      # 0xe94e
jmp 0x7a82
leaq 0x6ed3(%rip), %rsi      # 0xe94e
leaq 0x6ed2(%rip), %rdx      # 0xe954
movq %rsp, %rdi
xorl %eax, %eax
callq 0x42e0
xorl %edi, %edi
xorl %eax, %eax
callq 0x71ba
leaq 0x6be4(%rip), %rax      # 0xe680
movl (%rax,%r14,4), %esi
movq %rsp, %rdx
movl $0x46, %edi
movl $0x28, %ecx
xorl %eax, %eax
callq 0x6d47
movl $0x1, %edi
xorl %eax, %eax
callq 0x71ba
testl %ebx, %ebx
je 0x7acb
xorl %eax, %eax
callq 0x723e
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/jrrk[P]cbzone/c_graphics.c
// Function: screeninit
void screeninit()
{
  controlfont = gprloadfontfile(CONTROLFONT);
  titlefont = gprloadfontfile(TITLEFONT);
  generalfont = gprloadfontfile(GENERALFONT);
  staticscreen();
}

// Assembly:
pushq %rax
leaq 0x6e7b(%rip), %rdi      # 0xe956
xorl %eax, %eax
callq 0x7591
movq %rax, 0xcc67(%rip)      # 0x14750
leaq 0x6e93(%rip), %rdi      # 0xe983
xorl %eax, %eax
callq 0x7591
movq %rax, 0xcc5a(%rip)      # 0x14758
leaq 0x6eac(%rip), %rdi      # 0xe9b1
xorl %eax, %eax
callq 0x7591
movq %rax, 0xcc4d(%rip)      # 0x14760
popq %rax
jmp 0x7b19
// File: /workspace/github_c_makefile_star2_O1/jrrk[P]cbzone/c_graphics.c
// Function: xhairs
void xhairs (aligned)
     Bool aligned;
{
  static Bool last = False;
  static short pt1[] = {500, 215, 500, 235, 500, 285, 500, 305, 475, 240,
                          475, 235, 475, 235, 525, 235, 525, 235, 525, 240,
                          475, 280, 475, 285, 475, 285, 525, 285, 525, 285,
                          525, 280};
  static short pt2[] = {500, 215, 500, 235, 500, 285, 500, 305, 475, 245,
                          500, 235, 500, 235, 525, 245, 475, 275, 500, 285,
                          500, 285, 525, 275};
  static Bool draw = True;
  if (draw) {
    if (aligned) {
      if (!last) {
        gprsetdrawvalue(opt->cpi[COLOR_BG]);       /* erase the old */
        multiline(pt1, 8);
        last = True;
      }
      gprsetdrawvalue(opt->cpi[COLOR_XHAIR]);        /* draw the new */
      multiline(pt2, 6);
    }
    else {
      if (last) {
        gprsetdrawvalue(opt->cpi[COLOR_BG]);       /* erase the old */
        multiline(pt2, 6);
        last = False;
      }
      gprsetdrawvalue(opt->cpi[COLOR_XHAIR]);        /* draw the new */
      multiline(pt1, 8);
    }
  }
  draw = !draw;
}

// Assembly:
cmpl $0x0, 0xbc9d(%rip)      # 0x14410
je 0x8841
pushq %rax
movb 0xc028(%rip), %al       # 0x147a8
testl %edi, %edi
je 0x87de
testb $0x1, %al
jne 0x87b9
leaq 0xbe01(%rip), %rax      # 0x14590
movq (%rax), %rax
movl 0xf0(%rax), %edi
xorl %eax, %eax
callq 0x7608
leaq 0xbbfa(%rip), %rdi      # 0x143a0
movl $0x8, %esi
xorl %eax, %eax
callq 0x6e78
movb $0x1, 0xbfef(%rip)      # 0x147a8
leaq 0xbdd0(%rip), %rax      # 0x14590
movq (%rax), %rax
movl 0x104(%rax), %edi
xorl %eax, %eax
callq 0x7608
leaq 0xbc09(%rip), %rdi      # 0x143e0
movl $0x6, %esi
jmp 0x8836
testb $0x1, %al
je 0x8813
leaq 0xbda7(%rip), %rax      # 0x14590
movq (%rax), %rax
movl 0xf0(%rax), %edi
xorl %eax, %eax
callq 0x7608
leaq 0xbbe0(%rip), %rdi      # 0x143e0
movl $0x6, %esi
xorl %eax, %eax
callq 0x6e78
movb $0x0, 0xbf95(%rip)      # 0x147a8
leaq 0xbd76(%rip), %rax      # 0x14590
movq (%rax), %rax
movl 0x104(%rax), %edi
xorl %eax, %eax
callq 0x7608
leaq 0xbb6f(%rip), %rdi      # 0x143a0
movl $0x8, %esi
xorl %eax, %eax
callq 0x6e78
addq $0x8, %rsp
xorl %eax, %eax
cmpl $0x0, 0xbbc6(%rip)      # 0x14410
sete %al
movl %eax, 0xbbbd(%rip)      # 0x14410
retq
// File: /workspace/github_c_makefile_star2_O1/jrrk[P]cbzone/c_main.c
// Function: initarray
void initarray(o)
     Genericp o;
{
  Genericp s;
  Genericp g;
  Genericp pl = o;
  int i, j;

  pl->type = IS_PLAYER;                 /* player is always the first */
  pl->attr = START_LIVING;              /* object.  Same size as the */
  pl->criticalx = 45.0;                 /* other tanks.  */
  pl->criticaly = 70.0;
  for (g=o; g<o+opt->mobjects; g++) {
    g->ca = 1.0;                        /* for those objects which */
    for (j=0; j<5; j++)                 /* have rotating parts, set */
      g->dc[j].ctp = g->dc[j].cta = 1.0;  /* the cos to 1.0 */
  }

  s = o+opt->sstart;                    /* player gets msalvos, each  */
  pl->salvo = s;                        /* enemy gets one.  the salvos */
  for (i=0; i<opt->msalvos; i++) {      /* must know who their owner */
    s->salvo = pl;                      /* is for a variety of reasons */
    s->type = IS_SALVO;                 /* first the player */
    s->lntype = LN_SALVO;
    s++;
  }
  for (g=o+opt->estart; g<o+opt->lstart; g++) {
    g->salvo = s;                       /* now the enemies */
    s->salvo = g;
    s->type = IS_SALVO;
    s->lntype = LN_SALVO;
    s++;
  }
}

// Assembly:
movl $0x100, (%rdi)          # imm = 0x100
movl $0x3, 0x8(%rdi)
movabsq $0x428c000042340000, %rax # imm = 0x428C000042340000
movq %rax, 0x38(%rdi)
movq 0xb58e(%rip), %rax      # 0x14590
movslq 0x1c(%rax), %rcx
testq %rcx, %rcx
jle 0x904f
imulq $0x660, %rcx, %rcx      # imm = 0x660
addq %rdi, %rcx
movl $0x3f800000, %edx       # imm = 0x3F800000
movq %rdi, %rsi
movl $0x3f800000, 0x24(%rsi) # imm = 0x3F800000
movl $0x180, %r8d            # imm = 0x180
movl %edx, -0x8(%rsi,%r8)
movl %edx, (%rsi,%r8)
addq $0x130, %r8             # imm = 0x130
cmpq $0x770, %r8             # imm = 0x770
jne 0x902a
addq $0x660, %rsi            # imm = 0x660
cmpq %rcx, %rsi
jb 0x901d
movslq 0x28(%rax), %rcx
imulq $0x660, %rcx, %rcx      # imm = 0x660
addq %rdi, %rcx
movq %rcx, 0x650(%rdi)
movl 0x10(%rax), %esi
movabsq $0x700000080, %rdx      # imm = 0x700000080
testl %esi, %esi
jle 0x908a
movq %rdi, 0x650(%rcx)
movq %rdx, (%rcx)
addq $0x660, %rcx            # imm = 0x660
decl %esi
jne 0x9075
movslq 0x20(%rax), %rsi
movslq 0x24(%rax), %rax
cmpl %eax, %esi
jge 0x90cb
imulq $0x660, %rax, %rax      # imm = 0x660
addq %rdi, %rax
imulq $0x660, %rsi, %rsi      # imm = 0x660
addq %rdi, %rsi
movl $0x660, %edi            # imm = 0x660
movq %rcx, 0x650(%rsi)
movq %rsi, 0x650(%rcx)
movq %rdx, (%rcx)
addq %rdi, %rcx
addq %rdi, %rsi
cmpq %rax, %rsi
jb 0x90af
retq
// File: /workspace/github_c_makefile_star2_O1/jrrk[P]cbzone/c_move.c
// Function: movelander
void movelander(g, pl)
     Genericp g;
     Genericp pl;
{
  float dx, dy, theta;

  if (++g->pcount > 20) {
    g->pcount = 0;

    if (g->range <= 750.0) {
      dx = g->x - pl->x;
      dy = g->y - pl->y;
      theta = atan (dy / (fabs(dx) + 1.0));
      if (dx <= 0.0)
        theta = PI - theta;
      /* the original fortran went to all the trouble of calculating
       * theta above, but never used it.  perhaps the following
       * statement was left out.
       */
      g->azm = theta;
    }

    if (frand() >= 0.5) {
      g->azm += frand() * PI / 4.0;
    }
    else {
      g->azm -= frand() * PI / 4.0;
    }
    g->speed = frand() * 20.0;
  }
}

// Assembly:
movl 0x4c(%rdi), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x4c(%rdi)
cmpl $0x14, %eax
jl 0xce91
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl $0x0, 0x4c(%rdi)
movss 0x1ef1(%rip), %xmm0     # 0xec54
ucomiss 0x34(%rdi), %xmm0
jb 0xcddc
movss 0xc(%rbx), %xmm2
movss 0x10(%rbx), %xmm0
subss 0xc(%rsi), %xmm2
movaps %xmm2, (%rsp)
subss 0x10(%rsi), %xmm0
cvtss2sd %xmm0, %xmm0
movaps 0x12b4(%rip), %xmm1     # 0xe040
andps %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
addsd 0x134d(%rip), %xmm1     # 0xe0e8
divsd %xmm1, %xmm0
callq 0x4270
cvtsd2ss %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
movsd 0x1e01(%rip), %xmm2     # 0xebb8
subsd %xmm1, %xmm2
xorps %xmm1, %xmm1
cvtsd2ss %xmm2, %xmm1
xorps %xmm2, %xmm2
movaps (%rsp), %xmm3
cmpnless %xmm2, %xmm3
andps %xmm3, %xmm0
andnps %xmm1, %xmm3
orps %xmm0, %xmm3
movss %xmm3, 0x20(%rbx)
callq 0x4510
movl $0xffff, %ebp           # imm = 0xFFFF
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x1269(%rip), %xmm0     # 0xe060
movsd %xmm0, (%rsp)
callq 0x4510
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x124e(%rip), %xmm0     # 0xe060
mulsd 0x1d9e(%rip), %xmm0     # 0xebb8
mulsd 0x1dde(%rip), %xmm0     # 0xec00
xorps %xmm1, %xmm1
cvtss2sd 0x20(%rbx), %xmm1
movapd 0x17fe(%rip), %xmm2     # 0xe630
xorpd %xmm0, %xmm2
movsd 0x1cf2(%rip), %xmm3     # 0xeb30
cmpnlesd (%rsp), %xmm3
movapd %xmm3, %xmm4
andnpd %xmm0, %xmm4
andpd %xmm2, %xmm3
orpd %xmm4, %xmm3
addsd %xmm1, %xmm3
xorps %xmm0, %xmm0
cvtsd2ss %xmm3, %xmm0
movss %xmm0, 0x20(%rbx)
callq 0x4510
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x11e6(%rip), %xmm0     # 0xe060
mulsd 0x11e6(%rip), %xmm0     # 0xe068
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x2c(%rbx)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/jrrk[P]cbzone/c_parseopts.c
// Function: pager
int pager(file)
     char* file;
{
  char buf[100], *pager, *getenv();
  static char defaultpager[] = PAGER;
  FILE *f;

  if ((pager = getenv("PAGER")) == NULL)
    pager = defaultpager;
  sprintf(buf,"%s%s",TANKDIR,file);
  if ((f=fopen(buf,"r")) != NULL) {
    fclose(f);
    switch (fork()) {
    case 0:
#ifndef WIN31
      execl(pager,pager,buf,0);
#endif
      fprintf(stderr,"Exec of %s failed\n", pager);
      return 1;
    case -1:
      fprintf(stderr,"Unable to fork process\n");
      return 1;
    default:
#ifndef WIN31
      wait(0);
#endif
      break;
    }
  }
  else {
    fprintf(stderr,"File %s not found or unreadable.\n", buf);
    return 1;
  }
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdi, %r14
leaq 0x1eb9(%rip), %rdi      # 0xed60
callq 0x43d0
testq %rax, %rax
leaq 0x76f2(%rip), %rbx      # 0x145a8
cmovneq %rax, %rbx
leaq 0x1ea5(%rip), %rsi      # 0xed66
leaq 0x1ea3(%rip), %rdx      # 0xed6b
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x42e0
leaq 0x1b15(%rip), %rsi      # 0xe9f4
movq %r15, %rdi
callq 0x41a0
testq %rax, %rax
je 0xcf17
movq %rax, %rdi
callq 0x4500
callq 0x4530
cmpl $-0x1, %eax
je 0xcf41
testl %eax, %eax
je 0xcf34
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x4090
movl %ebx, %eax
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x50ca(%rip), %rax      # 0x11fe8
movq (%rax), %rdi
leaq 0x1e78(%rip), %rsi      # 0xeda0
movq %rsp, %rdx
xorl %eax, %eax
callq 0x4570
jmp 0xcf46
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x461c
jmp 0xcf46
callq 0x4600
movl $0x1, %ebx
jmp 0xcf0b
// File: /workspace/github_c_makefile_star2_O1/jrrk[P]cbzone/c_parseopts.c
// Function: getoptionint
int getoptionint(s)
     char *s;
{
  char rest[100];
  int num;

  if (sscanf(s, "%d%s", &num, rest) != 1) {
    printf("Error in optional argument %s; use -help for help.\n",
           s);
    exit(0);
  }
  return(num);
}

// Assembly:
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
leaq 0x1e63(%rip), %rsi      # 0xedc2
leaq 0xc(%rsp), %rdx
leaq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x40f0
cmpl $0x1, %eax
jne 0xcf82
movl 0xc(%rsp), %eax
addq $0x80, %rsp
popq %rbx
retq
leaq 0x1e3e(%rip), %rdi      # 0xedc7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4050
xorl %edi, %edi
callq 0x4110
// File: /workspace/github_c_makefile_star2_O1/jrrk[P]cbzone/c_scores.c
// Function: printandwait
void printandwait(s, c)                 /* print a string and then */
     char* s;                           /* wait for a character c  */
     char c;                            /* to be pressed.  If c==0 */
{                                       /* then any keypress will  */
  y += ydelta;                          /* do.                     */
  xprintf(s, True);
  waitforkey(c);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl 0x7585(%rip), %ebp      # 0x14918
addl 0x7583(%rip), %ebp      # 0x1491c
movl %ebp, 0x7579(%rip)      # 0x14918
movl 0x756e(%rip), %r15d     # 0x14914
callq 0x4280
movl %r15d, %edi
movl %ebp, %esi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x6d47
movl 0x7559(%rip), %eax      # 0x1491c
addl %eax, 0x754f(%rip)      # 0x14918
movsbl %bl, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7849
// File: /workspace/github_c_makefile_star2_O1/openshmem-org[P]openshmem-examples/c/add.c
// Function: main
int
main()
{
    int me;

    shmem_init();
    me = shmem_my_pe();

    dst = 22;
    shmem_barrier_all();

    if (me == 0) {
        shmem_int_atomic_add(&dst, 44, 1);
    }
    shmem_barrier_all();

    printf("%d: dst = %d\n", me, dst);

    shmem_finalize();

    return 0;
}

// Assembly:
pushq %rbx
callq 0x1080
callq 0x1060
movl %eax, %ebx
movl $0x16, 0x2eb9(%rip)     # 0x405c
callq 0x1070
testl %ebx, %ebx
jne 0x11c2
leaq 0x2ea9(%rip), %rdi      # 0x405c
movl $0x2c, %esi
movl $0x1, %edx
callq 0x1050
callq 0x1070
movl 0x2e8f(%rip), %edx      # 0x405c
leaq 0xe30(%rip), %rdi       # 0x2004
movl %ebx, %esi
xorl %eax, %eax
callq 0x1030
callq 0x1040
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]xpack/programs/prog_util.c
// Function: do_msg
static void
do_msg(const char *format, bool with_errno, va_list va)
{
	int saved_errno = errno;

	fprintf(stderr, "%"TS": ", program_invocation_name);
	vfprintf(stderr, format, va);
	if (with_errno)
		fprintf(stderr, ": %s\n", strerror(saved_errno));
	else
		fprintf(stderr, "\n");

	errno = saved_errno;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %r12
callq 0x1050
movq %rax, %rbx
movl (%rax), %ebp
movq 0x8db1(%rip), %r13      # 0x9ff8
movq (%r13), %rdi
movq 0x8ec6(%rip), %rdx      # 0xa118
leaq 0x664d(%rip), %rsi      # 0x78a6
xorl %eax, %eax
callq 0x1140
movq (%r13), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x11b0
movq (%r13), %r14
testl %r15d, %r15d
jne 0x1294
pushq $0xa
popq %rdi
movq %r14, %rsi
callq 0x1100
movl %ebp, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, %edi
callq 0x11e0
leaq 0x6609(%rip), %rsi      # 0x78ab
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1140
jmp 0x1283
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]xpack/programs/xpack.c
// Function: stat_file
static int
stat_file(struct file_stream *in, struct stat *stbuf, bool allow_hard_links)
{
	if (fstat(in->fd, stbuf) != 0) {
		msg("%"TS": unable to stat file", in->name);
		return -1;
	}

	if (!S_ISREG(stbuf->st_mode) && !in->is_standard_stream) {
		msg("%"TS" is %s -- skipping",
		    in->name, S_ISDIR(stbuf->st_mode) ? "a directory" :
							"not a regular file");
		return -2;
	}

	if (stbuf->st_nlink > 1 && !allow_hard_links) {
		msg("%"TS" has multiple hard links -- skipping "
		    "(use -f to process anyway)", in->name);
		return -2;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %edi
callq 0x11d0
testl %eax, %eax
je 0x47ca
movq 0x8(%rbx), %rsi
leaq 0x2c18(%rip), %rdi      # 0x73d4
xorl %eax, %eax
callq 0x4b60
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4831
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%r14), %eax
cmpl $0x8000, %eax           # imm = 0x8000
je 0x47e0
cmpb $0x0, 0x10(%rbx)
je 0x4803
cmpq $0x2, 0x10(%r14)
setb %cl
xorl %eax, %eax
orb %bpl, %cl
jne 0x4831
movq 0x8(%rbx), %rsi
leaq 0x2c26(%rip), %rdi      # 0x7420
xorl %eax, %eax
callq 0x4b60
jmp 0x482c
movq 0x8(%rbx), %rsi
cmpl $0x4000, %eax           # imm = 0x4000
leaq 0x2bee(%rip), %rax      # 0x7401
leaq 0x2bf3(%rip), %rdx      # 0x740d
cmoveq %rax, %rdx
leaq 0x2bc7(%rip), %rdi      # 0x73ec
xorl %eax, %eax
callq 0x4b60
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]xpack/programs/xpack.c
// Function: do_compress
static int
do_compress(struct xpack_compressor *compressor, struct file_stream *in,
	    struct file_stream *out, u32 chunk_size)
{
	void *original_buf = xmalloc(chunk_size);
	void *compressed_buf = xmalloc(chunk_size - 1);
	ssize_t ret = -1;

	if (original_buf == NULL || compressed_buf == NULL)
		goto out;

	while ((ret = xread(in, original_buf, chunk_size)) > 0) {
		u32 original_size = ret;
		u32 compressed_size;
		void *stored_buf;
		u32 stored_size;

		compressed_size = xpack_compress(compressor,
						 original_buf,
						 original_size,
						 compressed_buf,
						 original_size - 1);
		if (compressed_size == 0) {
			/* Store the chunk uncompressed */
			stored_buf = original_buf;
			stored_size = original_size;
		} else {
			/* Store the chunk compressed */
			stored_buf = compressed_buf;
			stored_size = compressed_size;
		}

		ret = write_chunk_header(out, stored_size, original_size);
		if (ret != 0)
			goto out;

		ret = full_write(out, stored_buf, stored_size);
		if (ret != 0)
			goto out;
	}
out:
	free(compressed_buf);
	free(original_buf);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %r15d
movq %rdx, %r14
movq %rsi, 0x20(%rsp)
movq %rdi, 0x10(%rsp)
movl %ecx, %edi
movq %rdi, 0x18(%rsp)
callq 0x4bea
movq %rax, %rbx
decl %r15d
movq %r15, %rdi
callq 0x4bea
movq %rax, %rbp
testq %rbx, %rbx
sete %al
testq %rbp, %rbp
sete %cl
orb %al, %cl
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jne 0x4b3c
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
movq 0x18(%rsp), %rdx
callq 0x4e29
movq %rax, %r12
testq %rax, %rax
jle 0x4b3c
movl %r12d, %edx
movl %r12d, %r8d
decl %r8d
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %rbp, %rcx
callq 0x2a78
movq %rax, %r15
testl %r15d, %r15d
movl %r15d, %r13d
cmovel %r12d, %r13d
movl %r13d, 0x8(%rsp)
movl %r12d, 0xc(%rsp)
movl $0x8, %edx
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0x4f74
testl %eax, %eax
je 0x4b17
movl %eax, %r12d
xorl %eax, %eax
jmp 0x4b34
testl %r15d, %r15d
movq %rbp, %rsi
cmoveq %rbx, %rsi
movl %r13d, %edx
movq %r14, %rdi
callq 0x4f74
movl %eax, %r12d
testl %eax, %eax
sete %al
testb %al, %al
jne 0x4ab0
movq %rbp, %rdi
callq 0x1040
movq %rbx, %rdi
callq 0x1040
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]xpack/programs/prog_util.c
// Function: xmalloc
void *
xmalloc(size_t size)
{
	void *p = malloc(size);
	if (p == NULL && size == 0)
		p = malloc(1);
	if (p == NULL)
		msg("Out of memory");
	return p;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x1160
movq %rax, %rbx
orq %rax, %r14
jne 0x4c0b
movl $0x1, %edi
callq 0x1160
movq %rax, %rbx
testq %rbx, %rbx
jne 0x4c1e
leaq 0x2a7d(%rip), %rdi      # 0x7694
xorl %eax, %eax
callq 0x4b60
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]xpack/programs/prog_util.c
// Function: xopen_for_read
int
xopen_for_read(const tchar *path, struct file_stream *strm)
{
	if (path == NULL) {
		strm->is_standard_stream = true;
		strm->name = T("standard input");
		strm->fd = STDIN_FILENO;
	#ifdef _WIN32
		_setmode(strm->fd, O_BINARY);
	#endif
		return 0;
	}

	strm->is_standard_stream = false;

	strm->name = quote_path(path);
	if (strm->name == NULL)
		return -1;

	strm->fd = topen(path, O_RDONLY | O_BINARY | O_NOFOLLOW);
	if (strm->fd < 0) {
		msg_errno("Can't open %"TS" for reading", strm->name);
		free(strm->name);
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
testq %rdi, %rdi
je 0x4cc1
movq %rdi, %r14
movb $0x0, 0x10(%rbx)
callq 0x4cdf
movq %rax, 0x8(%rbx)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x4cd8
xorl %ebp, %ebp
movq %r14, %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %eax, %eax
callq 0x1180
movl %eax, (%rbx)
testl %eax, %eax
jns 0x4cd8
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x133c
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x4cd8
movb $0x1, 0x10(%rbx)
leaq 0x29d6(%rip), %rax      # 0x76a2
movq %rax, 0x8(%rbx)
movl $0x0, (%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]xpack/programs/prog_util.c
// Function: quote_path
static tchar *
quote_path(const tchar *path)
{
	size_t len = tstrlen(path);
	tchar *result;

	result = xmalloc((1 + len + 1 + 1) * sizeof(tchar));
	if (result == NULL)
		return NULL;
	result[0] = '"';
	tmemcpy(&result[1], path, len);
	result[1 + len] = '"';
	result[1 + len + 1] = '\0';
	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x10a0
movq %rax, %r15
leaq 0x3(%rax), %rdi
callq 0x4bea
testq %rax, %rax
je 0x4d1e
movq %rax, %rbx
movb $0x22, (%rax)
movq %rax, %rdi
incq %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1150
movw $0x22, 0x1(%rbx,%r15)
jmp 0x4d20
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]xpack/programs/prog_util.c
// Function: xopen_for_write
int
xopen_for_write(const tchar *path, bool overwrite, struct file_stream *strm)
{
	if (path == NULL) {
		strm->is_standard_stream = true;
		strm->name = T("standard output");
		strm->fd = STDOUT_FILENO;
	#ifdef _WIN32
		_setmode(strm->fd, O_BINARY);
	#endif
		return 0;
	}

	strm->is_standard_stream = false;

	strm->name = quote_path(path);
	if (strm->name == NULL)
		goto err;
retry:
	strm->fd = topen(path, O_WRONLY | O_BINARY | O_NOFOLLOW |
				O_CREAT | O_EXCL, 0644);
	if (strm->fd < 0) {
		if (errno != EEXIST) {
			msg_errno("Can't open %"TS" for writing", strm->name);
			goto err;
		}
		if (!overwrite) {
			if (!isatty(STDERR_FILENO) || !isatty(STDIN_FILENO)) {
				msg("%"TS" already exists; use -f to overwrite",
				    strm->name);
				goto err;
			}
			fprintf(stderr, "%"TS": %"TS" already exists; "
				"overwrite? (y/n) ",
				program_invocation_name, strm->name);
			if (getchar() != 'y') {
				msg("Not overwriting.");
				goto err;
			}
		}
		if (tunlink(path) != 0) {
			msg_errno("Unable to delete %"TS, strm->name);
			goto err;
		}
		goto retry;
	}

	return 0;

err:
	free(strm->name);
	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
testq %rdi, %rdi
je 0x4dcf
movl %esi, %ebp
movq %rdi, %r15
movb $0x0, 0x10(%r14)
callq 0x4cdf
leaq 0x8(%r14), %rbx
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x4dfc
xorl %r12d, %r12d
movq %r15, %rdi
movl $0x200c1, %esi          # imm = 0x200C1
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x1180
movl %eax, (%r14)
testl %eax, %eax
jns 0x4e0a
callq 0x1050
cmpl $0x11, (%rax)
jne 0x4e16
testb %bpl, %bpl
jne 0x4db7
movl $0x2, %edi
callq 0x1080
testl %eax, %eax
je 0x4deb
xorl %edi, %edi
callq 0x1080
testl %eax, %eax
je 0x4deb
movq %rbx, %rdi
callq 0x135a
testb $0x1, %al
je 0x4dfc
movq %r15, %rdi
callq 0x1060
testl %eax, %eax
je 0x4d60
movq (%rbx), %rsi
leaq 0x2989(%rip), %rdi      # 0x7756
jmp 0x4e20
movb $0x1, 0x10(%r14)
leaq 0x28f0(%rip), %rax      # 0x76cb
movq %rax, 0x8(%r14)
movl $0x1, (%r14)
xorl %r12d, %r12d
jmp 0x4e0a
movq (%rbx), %rsi
leaq 0x2900(%rip), %rdi      # 0x76f5
xorl %eax, %eax
callq 0x4b60
movq (%rbx), %rdi
callq 0x1040
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rsi
leaq 0x28bb(%rip), %rdi      # 0x76db
xorl %eax, %eax
callq 0x12b1
jmp 0x4dfc
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]xpack/programs/prog_util.c
// Function: xread
ssize_t
xread(struct file_stream *strm, void *buf, size_t count)
{
	char *p = buf;
	size_t orig_count = count;

	while (count != 0) {
		ssize_t res = read(strm->fd, p, MIN(count, INT_MAX));
		if (res == 0)
			break;
		if (res < 0) {
			msg_errno("Error reading from %"TS, strm->name);
			return -1;
		}
		p += res;
		count -= res;
	}
	return orig_count - count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
leaq 0x2921(%rip), %r12      # 0x776a
movq %rdx, %r13
testq %r13, %r13
je 0x4ea7
movl (%r15), %edi
cmpq %rbp, %r13
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmovbq %r13, %rdx
movq %r14, %rsi
callq 0x1110
testq %rax, %rax
je 0x4e79
js 0x4e84
addq %rax, %r14
subq %rax, %r13
xorl %eax, %eax
jmp 0x4e7e
movl $0x3, %eax
testl %eax, %eax
je 0x4e4c
jmp 0x4e99
movq 0x8(%r15), %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x12b1
movl $0x1, %eax
jmp 0x4e7e
cmpl $0x3, %eax
je 0x4eaa
movq $-0x1, %rbx
jmp 0x4ead
xorl %r13d, %r13d
subq %r13, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]xpack/programs/prog_util.c
// Function: skip_bytes
int
skip_bytes(struct file_stream *strm, size_t count)
{
	size_t bufsize;
	char *buffer;
	ssize_t ret;

	if (count == 0)
		return 0;

	bufsize = MIN(count, 4096);
	buffer = xmalloc(bufsize);
	if (buffer == NULL)
		return -1;
	do {
		size_t n = MIN(count, bufsize);
		ret = xread(strm, buffer, n);
		if (ret < 0)
			goto out;
		if (ret != n) {
			msg("%"TS": unexpected end-of-file", strm->name);
			ret = -1;
			goto out;
		}
		count -= ret;
	} while (count != 0);
	ret = 0;
out:
	free(buffer);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x4f5a
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1000, %r13d          # imm = 0x1000
cmpq %r13, %rsi
cmovbq %rsi, %r13
movq %r13, %rdi
callq 0x4bea
testq %rax, %rax
je 0x4f5e
movq %rax, %r12
cmpq %r13, %rbx
movq %r13, %r15
cmovbq %rbx, %r15
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x4e29
movq %rax, %rbp
testq %rax, %rax
js 0x4f23
cmpq %r15, %rbp
jne 0x4f28
subq %rbp, %rbx
movb $0x1, %r15b
jmp 0x4f44
xorl %r15d, %r15d
jmp 0x4f44
movq 0x8(%r14), %rsi
xorl %r15d, %r15d
leaq 0x253d(%rip), %rdi      # 0x7473
xorl %eax, %eax
callq 0x4b60
movq $-0x1, %rbp
testb %r15b, %r15b
je 0x4f50
testq %rbx, %rbx
jne 0x4ef6
xorl %ebp, %ebp
movq %r12, %rdi
callq 0x1040
jmp 0x4f63
xorl %ebp, %ebp
jmp 0x4f63
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]xpack/programs/prog_util.c
// Function: full_write
int
full_write(struct file_stream *strm, const void *buf, size_t count)
{
	const char *p = buf;

	while (count != 0) {
		ssize_t res = write(strm->fd, p, MIN(count, INT_MAX));
		if (res <= 0) {
			msg_errno("Error writing to %"TS, strm->name);
			return -1;
		}
		p += res;
		count -= res;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %ebx, %ebx
testq %r14, %r14
je 0x4fdc
movl (%r12), %edi
cmpq %r13, %r14
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmovbq %r14, %rdx
movq %r15, %rsi
callq 0x1090
movq %rax, %rbp
testq %rax, %rax
jle 0x4fc2
addq %rbp, %r15
subq %rbp, %r14
testq %rbp, %rbp
jg 0x4f90
jmp 0x4fd7
movq 0x8(%r12), %rsi
leaq 0x27b2(%rip), %rdi      # 0x7780
xorl %eax, %eax
callq 0x12b1
jmp 0x4fbb
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
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_O1/ebiggers[P]xpack/programs/prog_util.c
// Function: xclose
int
xclose(struct file_stream *strm)
{
	int ret = 0;
	if (strm->fd >= 0 && !strm->is_standard_stream) {
		if (close(strm->fd) != 0) {
			msg_errno("Error closing %"TS, strm->name);
			ret = -1;
		}
		free(strm->name);
	}
	strm->fd = -1;
	strm->name = NULL;
	return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %edi
xorl %ebp, %ebp
testl %edi, %edi
js 0x5015
cmpb $0x0, 0x10(%rbx)
jne 0x5015
callq 0x10f0
xorl %ebp, %ebp
testl %eax, %eax
jne 0x502c
movq 0x8(%rbx), %rdi
callq 0x1040
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
movq $0x0, 0x8(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x8(%rbx), %rsi
leaq 0x275d(%rip), %rdi      # 0x7794
xorl %eax, %eax
callq 0x12b1
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x500c
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]xpack/programs/prog_util.c
// Function: alloc_compressor
struct xpack_compressor *
alloc_compressor(u32 chunk_size, int level)
{
	struct xpack_compressor *c;

	c = xpack_alloc_compressor(chunk_size, level);
	if (c == NULL) {
		msg_errno("Unable to allocate compressor with "
			  "chunk size %"PRIu32" and compression level %d",
			  chunk_size, level);
	}
	return c;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
movl %edi, %edi
callq 0x5368
movq %rax, %r14
testq %rax, %rax
je 0x50f6
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x273f(%rip), %rdi      # 0x783c
movl %ebp, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x12b1
jmp 0x50ee
// File: /workspace/github_c_makefile_star2_O1/ebiggers[P]xpack/programs/prog_util.c
// Function: alloc_decompressor
struct xpack_decompressor *
alloc_decompressor(void)
{
	struct xpack_decompressor *d;

	d = xpack_alloc_decompressor();
	if (d == NULL)
		msg_errno("Unable to allocate decompressor");

	return d;
}

// Assembly:
pushq %rbx
callq 0x67ec
movq %rax, %rbx
testq %rax, %rax
je 0x511d
movq %rbx, %rax
popq %rbx
retq
leaq 0x2762(%rip), %rdi      # 0x7886
xorl %eax, %eax
callq 0x12b1
jmp 0x5118
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/zmac/getoptn.c
// Function: getoptn
int getoptn(int argc,char *argv[],char *optstring)
{
char *ptr;

/* check for end of arg list */
if(optnind==argc || *(argv[optnind])!='-' || strlen(argv[optnind])<=1)
  return(-1);

if((ptr=strchr(optstring,argv[optnind][optnpos]))==NULL)
  return('?');		/* error: unknown option */
else
  {
  optnopt=*ptr;
  if(ptr[1]==':')
    {
    if(optnind==argc-1) return(':');	/* error: missing option */
    optnarg=argv[optnind+1];
    optnpos=1;
    optnind+=2;
    return(optnopt);	/* return early, avoiding the normal increment */
    }
  }

/* now increment position ready for next time.
 * no checking is done for the end of args yet - this is done on
 * the next call.
 */
optnpos++;
if(optnpos>=strlen(argv[optnind]))
  {
  optnpos=1;
  optnind++;
  }

return(optnopt);	/* return the found option */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq 0xb9a2(%rip), %r13      # 0xe100
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmpl %edi, %r13d
je 0x281a
movq %rsi, %rbx
movq (%rsi,%r13,8), %r14
cmpb $0x2d, (%r14)
jne 0x281a
movq %rdx, %r12
movl %edi, %ebp
movq %r14, %rdi
callq 0x2080
cmpq $0x2, %rax
jb 0x281a
movl 0xb968(%rip), %r15d     # 0xe104
movsbl (%r14,%r15), %esi
movq %r12, %rdi
callq 0x2060
testq %rax, %rax
je 0x27df
movsbl (%rax), %r12d
movl %r12d, 0xc95f(%rip)     # 0xf118
cmpb $0x3a, 0x1(%rax)
jne 0x27e7
decl %ebp
movl $0x3a, %r15d
cmpl %ebp, %r13d
je 0x281a
movq 0x8(%rbx,%r13,8), %rax
movq %rax, 0xc948(%rip)      # 0xf120
movl $0x2, %ecx
jmp 0x2803
movl $0x3f, %r15d
jmp 0x281a
incl %r15d
movl %r15d, 0xb913(%rip)     # 0xe104
movq %r14, %rdi
callq 0x2080
movl $0x1, %ecx
cmpq %r15, %rax
ja 0x2817
movl $0x1, 0xb8f7(%rip)      # 0xe104
addl %ecx, %r13d
movl %r13d, 0xb8e9(%rip)     # 0xe100
movl %r12d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/zmac/mio.c
// Function: mfopen
FILE *mfopen(char *filename,char *mode)
{
	UNUSED (filename);
	UNUSED (mode);
	if ((mhead = malloc(MALLOC_SIZE)) == NULL) {
		msize = 0;
		return (NULL);
	}
	msize = MALLOC_SIZE;
	mend = mptr = mhead;
	return (JUNK_FPTR);				/* not used */
}

// Assembly:
pushq %rax
movl $0x2710, %edi           # imm = 0x2710
callq 0x2160
movq %rax, 0xc8ea(%rip)      # 0xf128
testq %rax, %rax
je 0x2867
movl $0x2710, 0xc8e3(%rip)   # imm = 0x2710
movq %rax, 0xc8e4(%rip)      # 0xf138
movq %rax, 0xc8e5(%rip)      # 0xf140
movq 0xb776(%rip), %rax      # 0xdfd8
movq (%rax), %rax
jmp 0x2873
movl $0x0, 0xc8bf(%rip)      # 0xf130
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/zmac/mio.c
// Function: mfputc
int mfputc(unsigned int c,FILE *f)
{
	unsigned char *p;
	UNUSED (f);
	while (mptr >= mhead + msize) {
		if ((p = realloc(mhead,msize+MALLOC_SIZE)) == (unsigned char *)-1) {
			fputs("mio: out of memory\n",stderr);
			return (-1);
		}
		else {
			msize += MALLOC_SIZE;
			mptr = (unsigned char *) (p + (unsigned int)(mptr - mhead));
			mhead = p;
		}
	}
	*mptr = c & 255;
	mend = ++mptr;
	return c;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edi, %ebx
movq 0xc892(%rip), %r12      # 0xf138
movq 0xc87b(%rip), %r14      # 0xf128
movl 0xc87c(%rip), %r13d     # 0xf130
leaq (%r14,%r13), %rax
cmpq %rax, %r12
jae 0x28c2
movq %r12, %rcx
jmp 0x290d
addl $0x2710, %r13d          # imm = 0x2710
movl %r13d, %r15d
movq %r14, %rdi
movq %r15, %rsi
callq 0x21b0
cmpq $-0x1, %rax
je 0x292c
movl %r13d, 0xc84c(%rip)     # 0xf130
subl %r14d, %r12d
movq %rax, %rcx
addq %r12, %rcx
movq %rcx, 0xc844(%rip)      # 0xf138
movq %rax, 0xc82d(%rip)      # 0xf128
addl $0x2710, %r13d          # imm = 0x2710
movq %rax, %r14
cmpq %r15, %r12
movq %rcx, %r12
jae 0x28c9
movb %bl, (%rcx)
incq %rcx
movq %rcx, 0xc81f(%rip)      # 0xf138
movq %rcx, 0xc820(%rip)      # 0xf140
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x21f0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x2920
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/zmac/mio.c
// Function: mfread
int mfread(char *ptr, unsigned int size, unsigned int nitems, FILE *f)
{
	unsigned int i = 0;
	UNUSED (f);
	while (i < nitems) {
		if ((mptr + size) > mend)
			break;
		memcpy(ptr,mptr,size);
		ptr += size;
		mptr += size;
		i++;
	}
	return (i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movl %edx, 0x4(%rsp)
testl %edx, %edx
je 0x29f5
movq 0xc795(%rip), %rax      # 0xf138
movl %esi, %r15d
movq 0xc793(%rip), %r13      # 0xf140
movq %rax, 0x8(%rsp)
leaq (%rax,%r15), %r14
xorl %ebx, %ebx
xorl %ebp, %ebp
leaq (%r14,%rbx), %r12
cmpq %r13, %r12
ja 0x29f7
movq 0x10(%rsp), %rax
leaq (%rax,%rbx), %rdi
movq 0x8(%rsp), %rax
leaq (%rax,%rbx), %rsi
movq %r15, %rdx
callq 0x20a0
movq %r12, 0xc754(%rip)      # 0xf138
incl %ebp
addq %r15, %rbx
cmpl %ebp, 0x4(%rsp)
jne 0x29ba
movl 0x4(%rsp), %ebp
jmp 0x29f7
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/zmac/mio.c
// Function: mfwrite
int mfwrite(char *ptr, int size, int nitems, FILE *f)
{
	int i = 0;
	unsigned char *p;
	UNUSED (f);
	while (i < nitems) {
		while (mptr + size >= mhead + msize) {
			if ((p = realloc(mhead,msize+MALLOC_SIZE)) == (unsigned char *)-1){
				fputs("mio: out of memory\n",stderr);
				return (-1);
			}
			else {
				msize += MALLOC_SIZE;
				mptr = (unsigned char *) (p + (unsigned int)(mptr - mhead));
				mhead = p;
			}
		}
		if ((mptr + size) > mhead + msize)
			break;
		memcpy(mend,ptr,size);
		ptr += size;
		mend += size;
		mptr = mend;
	}
	return (i);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %eax, %eax
movl %edx, 0xc(%rsp)
testl %edx, %edx
jle 0x2aef
movq %rdi, 0x10(%rsp)
movq 0xc710(%rip), %r14      # 0xf140
movq 0xc6f1(%rip), %rbp      # 0xf128
movq 0xc6fa(%rip), %r15      # 0xf138
movl 0xc6eb(%rip), %r12d     # 0xf130
movslq %esi, %r13
leaq (%r15,%r13), %rax
movl %r12d, %ecx
addq %rbp, %rcx
cmpq %rcx, %rax
jae 0x2a5c
movq %rbp, %rbx
jmp 0x2aa4
addl $0x2710, %r12d          # imm = 0x2710
movq %rbp, %rdi
movq %r12, %rsi
callq 0x21b0
cmpq $-0x1, %rax
je 0x2ae5
movq %rax, %rbx
movl %r12d, 0xc6b2(%rip)     # 0xf130
subl %ebp, %r15d
addq %rax, %r15
movq %r15, 0xc6ad(%rip)      # 0xf138
movq %rax, 0xc696(%rip)      # 0xf128
leaq (%r15,%r13), %rax
movl %r12d, %ecx
addq %rbx, %rcx
movq %rbx, %rbp
cmpq %rcx, %rax
jae 0x2a5c
movq %r14, %rdi
movq 0x10(%rsp), %r15
movq %r15, %rsi
movq %r13, %rdx
callq 0x20a0
addq %r13, %r15
movq %r15, 0x10(%rsp)
addq %r13, %r14
movq %r14, 0xc677(%rip)      # 0xf140
movq %r14, 0xc668(%rip)      # 0xf138
movq %r14, %r15
movq %rbx, %rbp
cmpl $0x0, 0xc(%rsp)
jg 0x2a48
xorl %eax, %eax
jmp 0x2aef
callq 0x221c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/vusec[P]fpvi-scsb/leak_rate_win_size/leak_rate.c
// Function: unblock_signal
static void unblock_signal(int signum __attribute__((__unused__))) {              
  sigset_t sigs;                                                                  
  sigemptyset(&sigs);                                                             
  sigaddset(&sigs, signum);                                                       
  sigprocmask(SIG_UNBLOCK, &sigs, NULL);                                          
}

// Assembly:
pushq %rbx
subq $0x80, %rsp
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x401100
movq %rbx, %rdi
movl $0xb, %esi
callq 0x4011a0
movl $0x1, %edi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x401030
addq $0x80, %rsp
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/vusec[P]fpvi-scsb/common/helper.c
// Function: set_cpu
void set_cpu(int core_idx)
{
    cpu_set_t main_thread_mask;
    CPU_ZERO(&main_thread_mask);
    CPU_SET(core_idx, &main_thread_mask);
    if(sched_setaffinity(getpid(), sizeof(cpu_set_t), &main_thread_mask) == -1){
        fprintf(stderr, "Error setaffinity main thread\n");
        fflush(stdout);
        exit(EXIT_FAILURE);
    }

    assert(sched_getcpu() == core_idx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x88, %rsp
movl %edi, %ebx
xorps %xmm0, %xmm0
movaps %xmm0, -0x20(%rbp)
movaps %xmm0, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps %xmm0, -0x90(%rbp)
cmpl $0x3ff, %edi            # imm = 0x3FF
ja 0x40b0b7
movl $0x1, %eax
movl %ebx, %ecx
shlq %cl, %rax
movl %ebx, %ecx
shrl $0x6, %ecx
orq %rax, -0x90(%rbp,%rcx,8)
callq 0x401070
leaq -0x90(%rbp), %rdx
movl $0x80, %esi
movl %eax, %edi
callq 0x4010b0
cmpl $-0x1, %eax
je 0x40b0e7
callq 0x401160
cmpl %ebx, %eax
jne 0x40b0ec
addq $0x88, %rsp
popq %rbx
popq %rbp
retq
callq 0x402000
leaq 0x106e(%rip), %rdi      # 0x40c161
leaq 0x1082(%rip), %rsi      # 0x40c17c
leaq 0x1084(%rip), %rcx      # 0x40c185
movl $0x1e, %edx
callq 0x4010a0
// File: /workspace/github_c_makefile_star2_O1/vusec[P]fpvi-scsb/common/helper.c
// Function: create_thread
pthread_t create_thread(int core_idx, void *(*target_loop) (void *), void *arg)
{
    pthread_attr_t target_thread_attrs;
    pthread_attr_init(&target_thread_attrs);
    cpu_set_t target_thread_mask;

    CPU_ZERO(&target_thread_mask);
    CPU_SET(core_idx, &target_thread_mask);

    if(pthread_attr_setaffinity_np(&target_thread_attrs, sizeof(cpu_set_t), &target_thread_mask))
    {
        printf("Error setaffinity CPUID thread\n");
        fflush(stdout);
        exit(EXIT_FAILURE);
    }

    pthread_t target_thread;
    pthread_create(&target_thread, &target_thread_attrs, target_loop, arg);

    return target_thread;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r15d
leaq -0xd8(%rbp), %rdi
callq 0x4010d0
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movaps %xmm0, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps %xmm0, -0x90(%rbp)
movaps %xmm0, -0xa0(%rbp)
cmpl $0x3ff, %r15d           # imm = 0x3FF
ja 0x40b179
movl $0x1, %eax
movl %r15d, %ecx
shlq %cl, %rax
shrl $0x6, %r15d
orq %rax, -0xa0(%rbp,%r15,8)
leaq -0xd8(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
movl $0x80, %esi
callq 0x401040
testl %eax, %eax
jne 0x40b1bf
leaq -0x20(%rbp), %r15
leaq -0xd8(%rbp), %rsi
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x401120
movq (%r15), %rax
addq $0xc8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xfd1(%rip), %rdi       # 0x40c197
callq 0x401050
movq 0x2e16(%rip), %rax      # 0x40dfe8
movq (%rax), %rdi
callq 0x401110
movl $0x1, %edi
callq 0x401170
// File: /workspace/github_c_makefile_star2_O1/canboat[P]canboat/nmea0183/../common/common.c
// Function: getNow
uint64_t getNow(void)
{
  struct timeval tv;

  if (*fixedTimestamp != '\0')
  {
    return UINT64_C(1672527600000); // 2023-01-01 00:00
  }

  if (gettimeofday(&tv, (void *) 0) == 0)
  {
    uint64_t t    = tv.tv_sec;
    uint64_t msec = tv.tv_usec / 1000L;

    return t * 1000L + msec;
  }
  return 0L;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
cmpb $0x0, 0x4b00(%rip)      # 0x7190
je 0x269e
movabsq $0x1856a69d980, %rbx    # imm = 0x1856A69D980
jmp 0x26d6
xorl %ebx, %ebx
movq %rsp, %rdi
xorl %esi, %esi
callq 0x2120
testl %eax, %eax
jne 0x26d6
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%rsp)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
imulq $0x3e8, (%rsp), %rbx    # imm = 0x3E8
addq %rdx, %rbx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/canboat[P]canboat/nmea0183/../common/common.c
// Function: fmtTimestamp
const char *fmtTimestamp(char str[DATE_LENGTH], uint64_t when)
{
  if (fixedTimestamp[0] != '\0')
  {
    return (const char *) fixedTimestamp;
  }
  else
  {
    time_t    t;
    struct tm tm;
    int       msec;
    size_t    len;

    if (when == UINT64_C(0))
    {
      when = getNow();
    }

    t    = when / 1000L;
    msec = when % 1000L;
    gmtime_r(&t, &tm);
    strftime(str, DATE_LENGTH - 5, "%Y-%m-%dT%H:%M:%S", &tm);
    len = strlen(str);
    snprintf(str + len, DATE_LENGTH - len, ".%3.3dZ", msec);
    return str;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
cmpb $0x0, 0x4aa1(%rip)      # 0x7190
je 0x26fd
leaq 0x4a98(%rip), %rbx      # 0x7190
jmp 0x2780
movq %rsi, %r14
movq %rdi, %rbx
testq %rsi, %rsi
jne 0x2710
callq 0x2684
movq %rax, %r14
movq %r14, %rax
shrq $0x3, %rax
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
mulq %rcx
shrq $0x4, %rdx
movq %rsp, %rdi
movq %rdx, (%rdi)
imull $0x3e8, %edx, %eax      # imm = 0x3E8
subl %eax, %r14d
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x2110
leaq 0x1cf1(%rip), %rdx      # 0x443c
movl $0x37, %esi
movq %rbx, %rdi
movq %r15, %rcx
callq 0x21d0
movq %rbx, %rdi
callq 0x20b0
leaq (%rbx,%rax), %rdi
movl $0x3c, %esi
subq %rax, %rsi
leaq 0x1cd8(%rip), %rdx      # 0x444e
movl %r14d, %ecx
xorl %eax, %eax
callq 0x20e0
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/canboat[P]canboat/nmea0183/../common/common.c
// Function: logBase
static int logBase(LogLevel level, const char *format, va_list ap)
{
  char strTmp[DATE_LENGTH];

  if (level > logLevel)
  {
    return 0;
  }

  fprintf(stderr, "%s %s [%s] ", logLevels[level], fmtNow(strTmp), progName);

  return vfprintf(stderr, format, ap);
}

// Assembly:
xorl %eax, %eax
cmpl %edi, 0x4949(%rip)      # 0x7178
jae 0x2832
retq
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq 0x47ac(%rip), %r13      # 0x6ff8
movq (%r13), %r15
movl %edi, %eax
leaq 0x1bd3(%rip), %rcx      # 0x442c
movslq (%rcx,%rax,4), %r12
addq %rcx, %r12
movq %rsp, %rdi
xorl %esi, %esi
callq 0x26df
movq 0x495f(%rip), %r8       # 0x71d0
leaq 0x1d88(%rip), %rsi      # 0x4600
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2150
movq (%r13), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2210
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/canboat[P]canboat/nmea0183/../common/common.c
// Function: logAbort
void logAbort(const char *format, ...)
{
  va_list ap;
  va_start(ap, format);

  logBase(LOGLEVEL_FATAL, format, ap);
  va_end(ap);
  fflush(stderr);
  fflush(stdout);
  exit(2);
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, %r10
leaq 0x20(%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 0x2a29
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %rdi, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
xorl %edi, %edi
movq %r10, %rsi
callq 0x2827
movq 0x459e(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
callq 0x21a0
movq 0x456f(%rip), %rax      # 0x6fd8
movq (%rax), %rdi
callq 0x21a0
movl $0x2, %edi
callq 0x2220
// File: /workspace/github_c_makefile_star2_O1/canboat[P]canboat/nmea0183/../common/common.c
// Function: die
void die(const char *t)
{
  int   e = errno;
  char *s = 0;

  if (e)
  {
    s = strerror(e);
  }

  if (s)
  {
    logAbort("%s: %s\n", t, s);
  }
  else
  {
    logAbort("%s\n", t);
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2050
movl (%rax), %edi
testl %edi, %edi
jne 0x2a8e
xorl %eax, %eax
jmp 0x2a93
callq 0x2260
testq %rax, %rax
jne 0x2aa9
leaq 0x1bf2(%rip), %rdi      # 0x4691
movq %rbx, %rsi
xorl %eax, %eax
callq 0x29cb
leaq 0x1ae1(%rip), %rdi      # 0x4591
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x29cb
// File: /workspace/github_c_makefile_star2_O1/canboat[P]canboat/nmea0183/../common/common.c
// Function: setProgName
void setProgName(char *name)
{
  progName = strrchr(name, '/');
  if (!progName)
  {
    progName = strrchr(name, '\\');
  }
  if (!progName)
  {
    progName = name;
  }
  else
  {
    progName++;
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x2f, %esi
callq 0x2100
movq %rax, 0x46d5(%rip)      # 0x71d0
testq %rax, %rax
jne 0x2b14
movq %rbx, %rdi
movl $0x5c, %esi
callq 0x2100
movq %rax, 0x46bc(%rip)      # 0x71d0
movq 0x46b5(%rip), %rax      # 0x71d0
leaq 0x1(%rax), %rcx
testq %rax, %rax
cmoveq %rbx, %rcx
movq %rcx, 0x46a3(%rip)      # 0x71d0
popq %rbx
retq