LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/src/vm/display_color.c
// Function: init_colors
void		init_colors(t_player *p)
{
	float		i;
	short		r;
	short		g;
	short		b;
	int			c;

	c = 0;
	while (p != NULL)
	{
		color_content(p->id, &r, &g, &b);
		i = 11;
		while (--i > 0)
			init_color(
					100 + p->id * 10 + 9 - i,
					r + (((r + g + b) / 3 - r) + 400) * (i) / 25,
					g + (((r + g + b) / 3 - g) + 800) * (i) / 25,
					b + (((r + g + b) / 3 - b) + 700) * (i) / 25);
		init_pair(p->id, p->id, COLOR_BLACK);
		c++;
		p = p->next;
	}
	init_pairs(c);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
xorl %ebx, %ebx
leaq 0x12(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0xe(%rsp), %r13
pushq $0x3
popq %rbp
testq %r14, %r14
je 0x50a5
movswl (%r14), %edi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x21b0
movss 0x263e(%rip), %xmm4     # 0x75f8
addss 0x263a(%rip), %xmm4     # 0x75fc
ucomiss 0x263b(%rip), %xmm4     # 0x7604
movl (%r14), %eax
jbe 0x508e
imull $0xa, %eax, %eax
addl $0x6d, %eax
cvtsi2ss %eax, %xmm0
subss %xmm4, %xmm0
movswl 0x12(%rsp), %edi
cvtsi2ss %edi, %xmm1
cvttss2si %xmm0, %ecx
movswl 0x10(%rsp), %r8d
leal (%r8,%rdi), %eax
movswl 0xe(%rsp), %esi
addl %esi, %eax
cltd
idivl %ebp
movl %eax, %edx
subl %edi, %edx
addl $0x190, %edx            # imm = 0x190
cvtsi2ss %edx, %xmm0
mulss %xmm4, %xmm0
cvtsi2ss %r8d, %xmm2
movss 0x25e0(%rip), %xmm3     # 0x7600
divss %xmm3, %xmm0
addss %xmm1, %xmm0
movl %eax, %edx
subl %r8d, %edx
addl $0x320, %edx            # imm = 0x320
cvtsi2ss %edx, %xmm1
cvttss2si %xmm0, %edx
mulss %xmm4, %xmm1
divss %xmm3, %xmm1
addss %xmm2, %xmm1
cvtsi2ss %esi, %xmm0
cvttss2si %xmm1, %r8d
subl %esi, %eax
addl $0x2bc, %eax            # imm = 0x2BC
cvtsi2ss %eax, %xmm1
mulss %xmm4, %xmm1
divss %xmm3, %xmm1
addss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movswl %cx, %edi
movswl %dx, %esi
movswl %r8w, %edx
movswl %ax, %ecx
movss %xmm4, 0x14(%rsp)
callq 0x2190
movss 0x14(%rsp), %xmm4
jmp 0x4fba
movswl %ax, %edi
movl %edi, %esi
xorl %edx, %edx
callq 0x2160
incl %ebx
movq 0x38(%r14), %r14
jmp 0x4f97
movl %ebx, %edi
callq 0x4f0c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/libft/ft_endianness.c
// Function: ft_read_big_endian
long long	ft_read_big_endian(void *src, size_t length)
{
	long long		n;
	long long		power;
	unsigned char	*ptr;

	n = 0;
	power = 1;
	ptr = (unsigned char *)src;
	while (length > 0)
	{
		n += ((long long)ptr[length - 1]) * power;
		power <<= 8;
		length--;
	}
	if ((n & (power >> 1)) != 0)
		while (power != 0x0)
		{
			n |= power;
			power <<= 1;
		}
	return (n);
}

// Assembly:
pushq $0x1
popq %rcx
xorl %eax, %eax
movq %rsi, %rdx
subq $0x1, %rdx
jb 0x5255
movzbl -0x1(%rdi,%rsi), %esi
imulq %rcx, %rsi
addq %rsi, %rax
shlq $0x8, %rcx
movq %rdx, %rsi
jmp 0x523a
movq %rcx, %rdx
sarq %rdx
testq %rax, %rdx
setne %dl
testq %rcx, %rcx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x5279
orq %rcx, %rax
addq %rcx, %rcx
jne 0x5271
retq
nop
// File: /workspace/github_c_makefile_star2_O2/Orycterope[P]corewar/libft/printf/ft_printf_fd.c
// Function: ft_printf_fd
int			ft_printf_fd(int fd, const char *format, ...)
{
	va_list args;
	int		count;
	int		error;

	va_start(args, format);
	error = replace_conversion((char **)&format, args);
	if (error)
		count = -1;
	else
		count = ft_strlen(format);
	ft_putstr_spec_fd((char *)format, fd);
	free((void*)format);
	va_end(args);
	return (count);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %edi, 0x4(%rsp)
leaq 0x30(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x5458
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), %r14
movq %rdi, 0x10(%r14)
leaq 0x120(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r14)
movq %rsi, %rdi
callq 0x5640
movq %rax, %r15
movq %rax, %rdi
callq 0x554f
movq %rsp, %r12
leaq 0x8(%rsp), %r13
movl %eax, (%rsp)
movslq %eax, %rdi
cmpb $0x0, (%r15,%rdi)
je 0x550c
addq %r15, %rdi
movq %rdi, 0x8(%rsp)
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x5564
testq %rax, %rax
je 0x5519
movq %rax, %rbp
movq %r15, %rdi
movq %rax, %rsi
callq 0x5684
movq %rax, %rbx
movq %rbp, %rdi
callq 0x2040
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x5684
movq %rax, %rbp
movq %r15, %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movslq (%rsp), %rbx
movq %rbp, %rdi
addq %rbx, %rdi
callq 0x554f
addl %ebx, %eax
movq %rbp, %r15
jmp 0x5495
movq %r15, %rdi
callq 0x5630
movq %rax, %r14
jmp 0x5526
movslq (%rsp), %rax
movb $0x0, (%r15,%rax)
pushq $-0x1
popq %r14
movq %r15, %rdi
movl 0x4(%rsp), %esi
callq 0x5788
movq %r15, %rdi
callq 0x2040
movl %r14d, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/converters/cosy/cosy.c
// Function: compressCard
int compressCard(
  FILE *dest
)
{
  int i, spcount = 0, len = strlen(card);

  for (i = 0; i < len; i++) {
    if (!VALID(card[i]))
      return 4;

    if (card[i] != ' ') {
      if (spcount != 0) {
        size_t l = strlen(compr[spcount]);

        if (fwrite(compr[spcount], sizeof(char), l, dest) != l)
          return 3;
        outcount += l;
        spcount = 0;
      }
      if (fputc(card[i], dest) == EOF)
        return 3;
      outcount++;
    } else {
      if (++spcount == MAXSPACES) {
        size_t l = strlen(compr[spcount]);

        if (fwrite(compr[spcount], sizeof(char), l, dest) != l)
          return 3;
        outcount += l;
        spcount = 0;
      }
    }
  }
  /*
   * Terminate the card image.
   */
  fwrite("\x5F\x5E", sizeof(char), 2, dest);
  outcount += 2;
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x309f(%rip), %r14      # 0x42d0
movq %r14, %rdi
callq 0x1070
movq %rax, %r15
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
xorl %eax, %eax
cmpq %r12, %r15
je 0x1317
movb (%r12,%r14), %cl
cmpb $0x26, %cl
je 0x133b
leal -0x5f(%rcx), %edx
cmpb $-0x3f, %dl
jb 0x133b
cmpb $0x20, %cl
jne 0x12af
incl %eax
cmpl $0x3e, %eax
jne 0x130f
movq 0x301f(%rip), %rbp      # 0x42a0
movq %rbp, %rdi
callq 0x1070
movq %rax, %r13
movq %rbp, %rdi
pushq $0x1
popq %rsi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x1110
cmpq %r13, %rax
jne 0x1337
addl 0x3017(%rip), %r13d     # 0x42c4
jmp 0x1306
testl %eax, %eax
je 0x12ec
cltq
leaq 0x2df4(%rip), %rcx      # 0x40b0
movq (%rcx,%rax,8), %rbp
movq %rbp, %rdi
callq 0x1070
movq %rax, %r13
movq %rbp, %rdi
pushq $0x1
popq %rsi
movq %rax, %rdx
movq %rbx, %rcx
callq 0x1110
cmpq %r13, %rax
jne 0x1337
addl %r13d, 0x2fdc(%rip)     # 0x42c4
movb (%r12,%r14), %cl
movsbl %cl, %edi
movq %rbx, %rsi
callq 0x10a0
cmpl $-0x1, %eax
je 0x1337
movl 0x2fc1(%rip), %r13d     # 0x42c4
incl %r13d
movl %r13d, 0x2fb7(%rip)     # 0x42c4
xorl %eax, %eax
incq %r12
jmp 0x1248
leaq 0xf39(%rip), %rdi       # 0x2257
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
movq %rbx, %rcx
callq 0x1110
addl $0x2, 0x2f91(%rip)      # 0x42c4
xorl %eax, %eax
jmp 0x133e
pushq $0x3
jmp 0x133d
pushq $0x4
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/converters/cosy/cosy.c
// Function: decompressCard
int decompressCard(
  FILE *src
)
{
  int ch, i, spcount;

  idx = 0;

  while ((ch = fgetc(src)) != -1) {
    if (ch == 0)
      continue;

    if (ch == PREFIX) {
      if ((ch = fgetc(src)) == -1)
        break;

      switch (ch) {
        case 0x21: case 0x22: case 0x23: case 0x24: case 0x25:
          spcount = ch - 0x21 + 3;
          goto fill;

        case 0x27: case 0x28: case 0x29: case 0x2A: case 0x2B:
        case 0x2C: case 0x2D: case 0x2E: case 0x2F: case 0x30:
        case 0x31: case 0x32: case 0x33: case 0x34: case 0x35:
        case 0x36: case 0x37: case 0x38: case 0x39: case 0x3A:
        case 0x3B: case 0x3C: case 0x3D: case 0x3E: case 0x3F:
        case 0x40: case 0x41: case 0x42: case 0x43: case 0x44:
        case 0x45: case 0x46: case 0x47: case 0x48: case 0x49:
        case 0x4A: case 0x4B: case 0x4C: case 0x4D: case 0x4E:
        case 0x4F: case 0x50: case 0x51: case 0x52: case 0x53:
        case 0x54: case 0x55: case 0x56: case 0x57: case 0x58:
        case 0x59: case 0x5A: case 0x5B: case 0x5C: case 0x5D:
          spcount = ch - 0x27 + 8;
      fill:
          for (i = 0; i< spcount; i++) {
            if (idx != CARDLEN)
              card[idx++] = ' ';
          }
          break;

        case 0x5E:
          card[idx] = '\0';
          return 0;

        case 0x5F:
          card[idx] = '\0';
          return -2;
      }
    } else {
      if (idx != CARDLEN)
        card[idx++] = ch;
    }
  }
  card[idx] = '\0';
  return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
andl $0x0, 0x2f5e(%rip)      # 0x42c0
pushq $-0x1e
popq %rbp
leaq 0xc98(%rip), %r15       # 0x2004
pushq $0x50
popq %r12
leaq 0x2f59(%rip), %r14      # 0x42d0
pushq $-0x1f
popq %r13
movq %rbx, %rdi
callq 0x1090
testl %eax, %eax
je 0x137b
cmpl $0x5f, %eax
je 0x13ad
cmpl $-0x1, %eax
je 0x13fc
movslq 0x2f28(%rip), %rcx      # 0x42c0
cmpq $0x50, %rcx
je 0x137b
leal 0x1(%rcx), %edx
movl %edx, 0x2f19(%rip)      # 0x42c0
movb %al, (%rcx,%r14)
jmp 0x137b
movq %rbx, %rdi
callq 0x1090
leal 0x1(%rax), %ecx
cmpl $0x60, %ecx
ja 0x137b
movslq (%r15,%rcx,4), %rdx
addq %r15, %rdx
movl %ebp, %ecx
jmpq *%rdx
movl %r13d, %ecx
addl %ecx, %eax
movl 0x2eed(%rip), %ecx      # 0x42c0
subl $0x1, %eax
jb 0x137b
movl %r12d, %edx
cmpl $0x50, %ecx
je 0x13f1
leal 0x1(%rcx), %edx
movl %edx, 0x2ed7(%rip)      # 0x42c0
movslq %ecx, %rcx
movb $0x20, (%rcx,%r14)
movl %edx, %ecx
jmp 0x13d3
pushq $-0x2
popq %rax
jmp 0x13fc
xorl %eax, %eax
movslq 0x2ebd(%rip), %rcx      # 0x42c0
movb $0x0, (%rcx,%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/converters/cosy/cosy.c
// Function: writeCard
int writeCard(
  FILE *dest
)
{
  /*
   * Remove trailing spaces.
   */
  while (idx && (card[idx - 1] == ' '))
    card[--idx] = '\0';

  if (fprintf(dest, "%s\n", card) < 0)
    return -1;
  return 0;
}

// Assembly:
movslq 0x2ea2(%rip), %rdx      # 0x42c0
leal -0x1(%rdx), %eax
leaq 0x2ea8(%rip), %rcx      # 0x42d0
movq %rdx, %rsi
subq $0x1, %rsi
jb 0x144a
cmpb $0x20, -0x1(%rdx,%rcx)
jne 0x144a
movl %eax, 0x2e82(%rip)      # 0x42c0
movb $0x0, -0x1(%rdx,%rcx)
decl %eax
movq %rsi, %rdx
jmp 0x142b
pushq %rax
leaq 0xed4(%rip), %rsi       # 0x2326
leaq 0x2e77(%rip), %rdx      # 0x42d0
xorl %eax, %eax
callq 0x10c0
sarl $0x1f, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/converters/cosy/cosy.c
// Function: usage
void usage(void)
{
  fprintf(stderr,
          "Usage: cosy [-cd] <cosyfile> [file ...]\n");
  fprintf(stderr,
          "   Compress/decompress a COSY file\n");
  fprintf(stderr, "\nSwitches:\n\n");
  fprintf(stderr, " -c   Perform COSY compression\n");
  fprintf(stderr, " -d   Perform COSY decompression (the default)\n");
  exit(1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x2b88(%rip), %r14      # 0x3ff8
movq (%r14), %rcx
leaq 0xde0(%rip), %rdi       # 0x225a
pushq $0x28
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1110
movq (%r14), %rcx
leaq 0xdf1(%rip), %rdi       # 0x2283
pushq $0x23
popq %rsi
movq %rbx, %rdx
callq 0x1110
movq (%r14), %rcx
leaq 0xe00(%rip), %rdi       # 0x22a7
pushq $0xc
popq %rsi
movq %rbx, %rdx
callq 0x1110
movq (%r14), %rcx
leaq 0xdf8(%rip), %rdi       # 0x22b4
pushq $0x1f
popq %rsi
movq %rbx, %rdx
callq 0x1110
movq (%r14), %rcx
leaq 0xe03(%rip), %rdi       # 0x22d4
pushq $0x2f
popq %rsi
movq %rbx, %rdx
callq 0x1110
pushq $0x1
popq %rdi
callq 0x1100
// File: /workspace/github_c_makefile_star2_O2/simh[P]simtools/converters/cosy/cosy.c
// Function: main
int main(
  int argc,
  char *argv[]
)
{
  int ch;
  FILE *cosy;

  while ((ch = getopt(argc, argv, "cd")) != -1) {
    switch (ch) {
      case 'c':
        compress = 1;
        break;

      case 'd':
        compress = 0;
        break;

      default:
        usage();
    }
  }
  argc -= optind;
  argv += optind;

  if (argc < (compress ? 2 : 1))
    usage();

  /*
   * Open the COSY file.
   */
  if ((cosy = fopen(argv[0], compress ? "w" : "r")) == NULL) {
    fprintf(stderr, "Failed to open COSY file - %s\n", argv[0]);
    return 2;
  }
  argc--, argv++;

  if (compress) {
    return doCompress(cosy, argc, argv);
  }
  return doDecompress(cosy);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
leaq 0xe0d(%rip), %r15       # 0x2304
pushq $0x1
popq %rbp
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x10e0
movl %ebp, %ecx
cmpl $0x63, %eax
je 0x1515
cmpl $0x64, %eax
jne 0x151d
xorl %ecx, %ecx
movl %ecx, 0x2dad(%rip)      # 0x42c8
jmp 0x14fa
cmpl $-0x1, %eax
jne 0x15cf
movq 0x2aab(%rip), %rax      # 0x3fd8
movslq (%rax), %rax
subl %eax, %ebx
movl 0x2d90(%rip), %ecx      # 0x42c8
cmpl $0x1, %ecx
pushq $0x2
popq %rdx
sbbl $0x0, %edx
cmpl %edx, %ebx
jl 0x15cf
leaq (%r14,%rax,8), %r14
testl %ecx, %ecx
movq (%r14), %rdi
leaq 0xdb0(%rip), %rax       # 0x2309
leaq 0xda7(%rip), %rsi       # 0x2307
cmoveq %rax, %rsi
callq 0x10d0
testq %rax, %rax
je 0x15a6
cmpl $0x0, 0x2d53(%rip)      # 0x42c8
je 0x1594
addq $0x8, %r14
decl %ebx
movq %rax, %rdi
movl %ebx, %esi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x15d4
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x17d0
movq 0x2a4b(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq (%r14), %rdx
leaq 0xd51(%rip), %rsi       # 0x230b
xorl %eax, %eax
callq 0x10c0
pushq $0x2
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x1465
// File: /workspace/github_c_makefile_star2_O2/eridanhq[P]miraclelib/setpwr.c
// Function: main
int main(int argc, char *argv[])
{
	FILE * fp;
	int memfd;
	void *mapped_base;

	int pwr_val;

	pwr_val = atoi(argv[1]);

	memfd = open("/dev/mem", O_RDWR | O_SYNC);
	if (memfd == -1) {
		printf("Can't open /dev/mem.\n");
		exit(0);
	}

	// Map one page of memory into user space such that the device is in that page, but it may not
	// be at the start of the page
	mapped_base = mmap( (void *) MEM0_BASE_ADDRESS, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, memfd, SPI_BASE_ADDRESS);
	if (mapped_base == (void *) -1) {
		printf("Can't map the memory to user space.\n");
		exit(0);
	}

	/* ----------- INSERT CODE BELOW THIS LINE ------------ */

	set_pwr_tx(pwr_val, mapped_base);

	/* ----------- INSERT CODE ABOVE THIS LINE ------------ */

	if (munmap(mapped_base, MAP_SIZE) == -1) {
		printf("Can't unmap memory from user space.\n");
		exit(0);
	}
	close(memfd);


	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x8(%rsi), %rdi
callq 0x1110
movl %eax, %ebp
leaq 0xda2(%rip), %rdi       # 0x2004
movl $0x101002, %esi         # imm = 0x101002
xorl %eax, %eax
callq 0x10f0
cmpl $-0x1, %eax
je 0x12c6
movl %eax, %ebx
pushq $0x3
popq %rdx
pushq $0x11
popq %rcx
movl $0x40000000, %edi       # imm = 0x40000000
movl $0x400000, %esi         # imm = 0x400000
movl $0x64000000, %r9d       # imm = 0x64000000
movl %eax, %r8d
callq 0x1080
cmpq $-0x1, %rax
je 0x12cf
movq %rax, %r14
movl %ebp, %edi
movq %rax, %rsi
callq 0x1ad9
movl $0x400000, %esi         # imm = 0x400000
movq %r14, %rdi
callq 0x10e0
cmpl $-0x1, %eax
je 0x12d8
movl %ebx, %edi
callq 0x10c0
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xd88(%rip), %rdi       # 0x2055
jmp 0x12df
leaq 0xd5b(%rip), %rdi       # 0x2031
jmp 0x12df
leaq 0xd2e(%rip), %rdi       # 0x200d
callq 0x1060
xorl %edi, %edi
callq 0x1130
nop
// File: /workspace/github_c_makefile_star2_O2/begriffs[P]pthread-test/alarm.c
// Function: main
int main(void)
{
	int seconds;
	char line[128], message[64];

	while (printf("Alarm> ") && fgets(line, sizeof(line), stdin))
	{
		if (strlen(line) <= 1)
			continue;
		if (sscanf(line, "%d %64[^\n]", &seconds, message) < 2)
			fputs("Bad command\n", stderr);
		else
		{
			sleep(seconds);
			printf("(%d) %s\n", seconds, message);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
leaq 0xe60(%rip), %rbx       # 0x2004
movq 0x2e2d(%rip), %rbp      # 0x3fd8
leaq 0x50(%rsp), %r14
leaq 0xe55(%rip), %r15       # 0x200c
leaq 0xc(%rsp), %r12
leaq 0x10(%rsp), %r13
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1040
testl %eax, %eax
je 0x1246
movq (%rbp), %rdx
movq %r14, %rdi
movl $0x80, %esi
callq 0x1060
testq %rax, %rax
je 0x1246
movq %r14, %rdi
callq 0x1030
cmpq $0x2, %rax
jb 0x11c1
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x1070
cmpl $0x1, %eax
jle 0x122b
movl 0xc(%rsp), %edi
callq 0x1080
movl 0xc(%rsp), %esi
leaq 0xe05(%rip), %rdi       # 0x2024
movq %r13, %rdx
xorl %eax, %eax
callq 0x1040
jmp 0x11c1
movq 0x2dc6(%rip), %rax      # 0x3ff8
movq (%rax), %rsi
leaq 0xddb(%rip), %rdi       # 0x2017
callq 0x1050
jmp 0x11c1
xorl %eax, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/util.c
// Function: xmalloc
SOLOCAL void *xmalloc(size_t size)
{
    void *m = malloc(size);
    if (!m)
    {
        logmsg(L_FATAL, "memory allocation failed.");
        abort();
    }
    return m;
}

// Assembly:
pushq %rax
callq 0x54f0
testq %rax, %rax
je 0x58a9
popq %rcx
retq
leaq 0x8372(%rip), %rsi      # 0xdc22
xorl %edi, %edi
callq 0x5960
callq 0x50a0
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/util.c
// Function: xrealloc
SOLOCAL void *xrealloc(void *ptr, size_t size)
{
    void *m = realloc(ptr, size);
    if (!m)
    {
        logmsg(L_FATAL, "memory allocation failed.");
        abort();
    }
    return m;
}

// Assembly:
pushq %rax
callq 0x55c0
testq %rax, %rax
je 0x58c9
popq %rcx
retq
leaq 0x8352(%rip), %rsi      # 0xdc22
xorl %edi, %edi
callq 0x5960
callq 0x50a0
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/util.c
// Function: upperstr
SOLOCAL char *upperstr(const char *src)
{
    if (!src) return 0;
    char *upper = xmalloc(strlen(src) +1);
    const char *r = src;
    char *w = upper;
    while (*r)
    {
	*w++ = toupper(*r++);
    }
    *w = 0;
    return upper;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x594c
movq %rdi, %rbx
callq 0x5260
leaq 0x1(%rax), %rdi
callq 0x589c
movq %rax, %r14
xorl %r15d, %r15d
movsbq (%rbx,%r15), %r12
testq %r12, %r12
je 0x5945
callq 0x5050
movq (%rax), %rax
movb (%rax,%r12,4), %al
movb %al, (%r14,%r15)
incq %r15
jmp 0x5926
movb $0x0, (%r14,%r15)
jmp 0x594f
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/log.c
// Function: logfmt
SOLOCAL void logfmt(LogLevel level, const char *format, ...)
{
    if (logsilent && level > L_ERROR) return;
    if (level > maxlevel) return;
    char buf[8192];
    va_list ap;
    va_start(ap, format);
    vsnprintf(buf, 8192, format, ap);
    va_end(ap);
    logmsg(level, buf);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x20d8, %rsp           # imm = 0x20D8
testb %al, %al
je 0x59d2
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 %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
cmpl $0x0, 0xda1b(%rip)      # 0x13408
setne %al
cmpl $0x2, %edi
setae %cl
testb %al, %cl
jne 0x5a4e
movl %edi, %ebx
cmpl %edi, 0xd9ee(%rip)      # 0x133f0
jb 0x5a4e
movq %rsi, %r10
leaq 0x20(%rsp), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
leaq 0x20f0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0xd0(%rsp), %r14
movl $0x2000, %esi           # imm = 0x2000
movq %r14, %rdi
movq %r10, %rdx
callq 0x5160
movl %ebx, %edi
movq %r14, %rsi
callq 0x5960
addq $0x20d8, %rsp           # imm = 0x20D8
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/log.c
// Function: writeFile
static void writeFile(LogLevel level, const char *message, void *data)
{
    FILE *target = data;
    fputs(levels[level], target);
    fputs(message, target);
    fputc('\n', target);
    fflush(target);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %eax
leaq 0x7577(%rip), %rcx      # 0xd000
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
movq %rdx, %rsi
callq 0x52f0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x52f0
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x53d0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5500
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/sector.c
// Function: Sector_createAt
SOEXPORT Sector *Sector_createAt(uint8_t tracknum, uint8_t sectornum)
{
    Sector *self = Sector_create();
    Sector_setTrackNum(self, tracknum);
    Sector_setSectorNum(self, sectornum);
    return self;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
callq 0x5410
movb %bpl, (%rax)
movb %bl, 0x1(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/track.c
// Function: Track_create
SOEXPORT Track *Track_create(uint8_t tracknum)
{
    uint8_t sectors = getsectors(tracknum);
    if (!sectors)
    {
        logfmt(L_ERROR, "Track: invalid track number %hhu.", tracknum);
        return 0;
    }
    Track *self = xmalloc(sizeof *self + sectors * sizeof *self->sector);
    for (uint8_t sectornum = 0; sectornum < sectors; ++sectornum)
    {
	self->sector[sectornum] = Sector_createAt(tracknum, sectornum);
    }
    self->tracknum = tracknum;
    self->sectors = sectors;
    return self;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebx
leal -0x2b(%rbx), %eax
cmpb $-0x2a, %al
jae 0x5b52
movzbl %bl, %edx
leaq 0x7503(%rip), %rsi      # 0xd046
xorl %r14d, %r14d
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x598d
jmp 0x5ba5
movb $0x15, %al
cmpb $0x12, %bl
jb 0x5b67
movb $0x13, %al
cmpb $0x19, %bl
jb 0x5b67
xorl %eax, %eax
cmpb $0x1f, %bl
adcb $0x11, %al
movzbl %al, %r15d
movl %r15d, %eax
shlb $0x3, %al
addb $0x8, %al
movzbl %al, %edi
callq 0x589c
movq %rax, %r14
xorl %r12d, %r12d
movzbl %bl, %ebp
cmpq %r12, %r15
je 0x5b9e
movzbl %r12b, %esi
movl %ebp, %edi
callq 0x5740
movq %rax, 0x8(%r14,%r12,8)
incq %r12
jmp 0x5b84
movb %bl, (%r14)
movb %r15b, 0x1(%r14)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/track.c
// Function: Track_rsector
SOEXPORT const Sector *Track_rsector(const Track *self, uint8_t sectornum)
{
    if (sectornum >= self->sectors)
    {
        logfmt(L_WARNING, "Track_rsector: invalid sector number %hhu "
		"requested.", sectornum);
        return 0;
    }
    return self->sector[sectornum];
}

// Assembly:
pushq %rbx
cmpb %sil, 0x1(%rdi)
jbe 0x5bc3
movzbl %sil, %eax
movq 0x8(%rdi,%rax,8), %rbx
jmp 0x5bda
movzbl %sil, %edx
leaq 0x749a(%rip), %rsi      # 0xd068
xorl %ebx, %ebx
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x598d
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/track.c
// Function: Track_sector
SOEXPORT Sector *Track_sector(Track *self, uint8_t sectornum)
{
    if (sectornum >= self->sectors)
    {
        logfmt(L_WARNING, "Track_sector: invalid sector number %hhu requested.",
                sectornum);
        return 0;
    }
    return self->sector[sectornum];
}

// Assembly:
pushq %rbx
cmpb %sil, 0x1(%rdi)
jbe 0x5bf1
movzbl %sil, %eax
movq 0x8(%rdi,%rax,8), %rbx
jmp 0x5c08
movzbl %sil, %edx
leaq 0x74a1(%rip), %rsi      # 0xd09d
xorl %ebx, %ebx
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x598d
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/track.c
// Function: Track_destroy
SOEXPORT void Track_destroy(Track *self)
{
    if (!self) return;
    for (uint8_t sectornum = 0; sectornum < self->sectors; ++sectornum)
    {
	Sector_destroy(self->sector[sectornum]);
    }
    free(self);
}

// Assembly:
testq %rdi, %rdi
je 0x5c4a
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movzbl 0x1(%rbx), %eax
cmpq %rax, %r14
jae 0x5c3b
movq 0x8(%rbx,%r14,8), %rdi
callq 0x51a0
incq %r14
jmp 0x5c23
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5080
retq
nop
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/d64.c
// Function: D64_create
SOEXPORT D64 *D64_create(D64Type type)
{
    if (type < 0 || type > 2)
    {
        logmsg(L_ERROR, "D64: invalid type argument.");
        return 0;
    }
    D64 *self = xmalloc(sizeof *self + tracks[type] * sizeof *self->track);
    for (uint8_t tracknum = 0; tracknum < tracks[type]; ++tracknum)
    {
	self->track[tracknum] = Track_create(tracknum+1);
    }
    self->type = type;
    return self;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x3, %edi
jb 0x5c6d
leaq 0x7471(%rip), %rsi      # 0xd0d1
pushq $0x1
popq %rdi
callq 0x5960
xorl %r14d, %r14d
jmp 0x5cb3
movl %edi, %ebx
movl %edi, %eax
leaq 0x74d6(%rip), %rcx      # 0xd14e
movzbl (%rax,%rcx), %r15d
leaq 0x8(,%r15,8), %rdi
callq 0x589c
movq %rax, %r14
negq %r15
pushq $0x1
popq %r12
leaq (%r15,%r12), %rax
cmpq $0x1, %rax
je 0x5cb0
movzbl %r12b, %edi
callq 0x51c0
movq %rax, (%r14,%r12,8)
incq %r12
jmp 0x5c94
movl %ebx, (%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/d64.c
// Function: D64_rtrack
SOEXPORT const Track *D64_rtrack(const D64 *self, uint8_t tracknum)
{
    if (!tracknum || tracknum > tracks[D64_type(self)])
    {
        logfmt(L_WARNING, "D64_rtrack: invalid track number %hhu requested.",
                tracknum);
        return 0;
    }
    return self->track[tracknum-1];
}

// Assembly:
pushq %rbx
testl %esi, %esi
je 0x5ce6
movl (%rdi), %eax
leaq 0x746e(%rip), %rcx      # 0xd14e
cmpb %sil, (%rax,%rcx)
jae 0x5cff
movzbl %sil, %edx
leaq 0x73fc(%rip), %rsi      # 0xd0ed
xorl %ebx, %ebx
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x598d
jmp 0x5d0a
movzbl %sil, %eax
decl %eax
movq 0x8(%rdi,%rax,8), %rbx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/d64.c
// Function: D64_track
SOEXPORT Track *D64_track(D64 *self, uint8_t tracknum)
{
    if (!tracknum || tracknum > tracks[D64_type(self)])
    {
        logfmt(L_WARNING, "D64_track: invalid track number %hhu requested.",
                tracknum);
        return 0;
    }
    return self->track[tracknum-1];
}

// Assembly:
pushq %rbx
testl %esi, %esi
je 0x5d23
movl (%rdi), %eax
leaq 0x7431(%rip), %rcx      # 0xd14e
cmpb %sil, (%rax,%rcx)
jae 0x5d3c
movzbl %sil, %edx
leaq 0x73f0(%rip), %rsi      # 0xd11e
xorl %ebx, %ebx
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x598d
jmp 0x5d47
movzbl %sil, %eax
decl %eax
movq 0x8(%rdi,%rax,8), %rbx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/d64.c
// Function: D64_destroy
SOEXPORT void D64_destroy(D64 *self)
{
    if (!self) return;
    for (uint8_t tracknum = 0; tracknum < tracks[D64_type(self)]; ++tracknum)
    {
	Track_destroy(self->track[tracknum]);
    }
    free(self);
}

// Assembly:
testq %rdi, %rdi
je 0x5dc5
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
leaq 0x73b1(%rip), %r15      # 0xd14e
movl (%rbx), %eax
movzbl (%rax,%r15), %eax
cmpq %rax, %r14
jae 0x5db8
movq 0x8(%rbx,%r14,8), %rdi
callq 0x5600
incq %r14
jmp 0x5d9d
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x5080
retq
nop
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/filedata.c
// Function: FileData_create
SOEXPORT FileData *FileData_create(void)
{
    FileData *self = xmalloc(sizeof *self);
    self->content = xmalloc(FD_CHUNKSIZE);
    self->size = 0;
    self->capacity = FD_CHUNKSIZE;
    self->changedEvent = Event_create(0, self);
    return self;
}

// Assembly:
pushq %rbx
pushq $0x20
popq %rdi
callq 0x589c
movq %rax, %rbx
movl $0x400, %edi            # imm = 0x400
callq 0x589c
movq %rax, 0x18(%rbx)
andq $0x0, (%rbx)
movq $0x400, 0x8(%rbx)       # imm = 0x400
xorl %edi, %edi
movq %rbx, %rsi
callq 0x5280
movq %rax, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/filedata.c
// Function: FileData_clone
SOEXPORT FileData *FileData_clone(const FileData *self)
{
    FileData *cloned = xmalloc(sizeof *cloned);
    cloned->size = self->size;
    cloned->capacity = self->capacity;
    cloned->content = xmalloc(self->capacity);
    cloned->changedEvent = Event_create(0, cloned);
    memcpy(cloned->content, self->content, self->size);
    return cloned;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x20
popq %rdi
callq 0x589c
movq %rax, %r14
movq (%rbx), %rax
movq %rax, (%r14)
movq 0x8(%rbx), %rdi
movq %rdi, 0x8(%r14)
callq 0x589c
movq %rax, 0x18(%r14)
xorl %edi, %edi
movq %r14, %rsi
callq 0x5280
movq %rax, 0x10(%r14)
movq 0x18(%r14), %rdi
movq (%rbx), %rdx
movq 0x18(%rbx), %rsi
callq 0x54a0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/filedata.c
// Function: FileData_append
SOEXPORT int FileData_append(FileData *self, const uint8_t *data, size_t size)
{
    if (self->size + size < size || self->size + size > FILEDATA_MAXSIZE)
    {
        logmsg(L_ERROR, "FileData_append: maximum size exceeded.");
        return -1;
    }
    while (self->size + size > self->capacity)
    {
        self->capacity += FD_CHUNKSIZE;
        self->content = xrealloc(self->content, self->capacity);
    }
    memcpy(self->content + self->size, data, size);
    self->size += size;
    Event_raise(self->changedEvent, 0);
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq %rdi, %rax
addq %rdx, %rax
setb %cl
cmpq $0x100001, %rax         # imm = 0x100001
setae %al
orb %cl, %al
je 0x61d9
leaq 0x736c(%rip), %rsi      # 0xd538
pushq $0x1
popq %rdi
callq 0x5960
pushq $-0x1
popq %rbx
jmp 0x6228
movq %rdx, %rbx
movq %rsi, %r15
leaq (%rdi,%rbx), %rax
movq 0x8(%r14), %rsi
cmpq %rsi, %rax
jbe 0x6209
addq $0x400, %rsi            # imm = 0x400
movq %rsi, 0x8(%r14)
movq 0x18(%r14), %rdi
callq 0x58bc
movq %rax, 0x18(%r14)
movq (%r14), %rdi
jmp 0x61df
addq 0x18(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x54a0
addq %rbx, (%r14)
movq 0x10(%r14), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x5610
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/filedata.c
// Function: FileData_appendByte
SOEXPORT int FileData_appendByte(FileData *self, uint8_t byte)
{
    if (self->size == FILEDATA_MAXSIZE)
    {
        logmsg(L_ERROR, "FileData_appendByte: maximum size exceeded.");
        return -1;
    }
    if (self->size == self->capacity)
    {
        self->capacity += FD_CHUNKSIZE;
        self->content = xrealloc(self->content, self->capacity);
    }
    self->content[self->size++] = byte;
    Event_raise(self->changedEvent, 0);
    return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq (%rdi), %rsi
cmpq $0x100000, %rsi         # imm = 0x100000
jne 0x6255
leaq 0x7318(%rip), %rsi      # 0xd560
pushq $0x1
popq %rdi
callq 0x5960
pushq $-0x1
popq %rbx
jmp 0x6297
movq %rdi, %rbx
cmpq 0x8(%rdi), %rsi
jne 0x627b
addq $0x400, %rsi            # imm = 0x400
movq %rsi, 0x8(%rbx)
movq 0x18(%rbx), %rdi
callq 0x58bc
movq %rax, 0x18(%rbx)
movq (%rbx), %rsi
jmp 0x627f
movq 0x18(%rbx), %rax
leaq 0x1(%rsi), %rcx
movq %rcx, (%rbx)
movb %bpl, (%rax,%rsi)
movq 0x10(%rbx), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x5610
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/filedata.c
// Function: FileData_appendBytes
SOEXPORT int FileData_appendBytes(FileData *self, uint8_t byte, size_t count)
{
    if (self->size + count < count || self->size + count > FILEDATA_MAXSIZE)
    {
        logmsg(L_ERROR, "FileData_appendBytes: maximum size exceeded.");
        return -1;
    }
    while (self->size + count > self->capacity)
    {
        self->capacity += FD_CHUNKSIZE;
        self->content = xrealloc(self->content, self->capacity);
    }
    memset(self->content + self->size, byte, count);
    self->size += count;
    Event_raise(self->changedEvent, 0);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq %rdi, %rax
addq %rdx, %rax
setb %cl
cmpq $0x100001, %rax         # imm = 0x100001
setae %al
orb %cl, %al
je 0x62d4
leaq 0x72c5(%rip), %rsi      # 0xd58c
pushq $0x1
popq %rdi
callq 0x5960
pushq $-0x1
popq %rbx
jmp 0x6323
movq %rdx, %rbx
movl %esi, %ebp
leaq (%rdi,%rbx), %rax
movq 0x8(%r14), %rsi
cmpq %rsi, %rax
jbe 0x6303
addq $0x400, %rsi            # imm = 0x400
movq %rsi, 0x8(%r14)
movq 0x18(%r14), %rdi
callq 0x58bc
movq %rax, 0x18(%r14)
movq (%r14), %rdi
jmp 0x62d9
addq 0x18(%r14), %rdi
movzbl %bpl, %esi
movq %rbx, %rdx
callq 0x5330
addq %rbx, (%r14)
movq 0x10(%r14), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x5610
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/filedata.c
// Function: FileData_setByte
SOEXPORT int FileData_setByte(FileData *self, uint8_t byte, size_t pos)
{
    if (pos >= self->size)
    {
	logmsg(L_ERROR, "FileData_setByte: invalid position.");
	return -1;
    }
    self->content[pos] = byte;
    return 0;
}

// Assembly:
cmpq %rdx, (%rdi)
jbe 0x633a
movq 0x18(%rdi), %rax
movb %sil, (%rax,%rdx)
xorl %eax, %eax
retq
pushq %rax
leaq 0x7277(%rip), %rsi      # 0xd5b9
pushq $0x1
popq %rdi
callq 0x5960
pushq $-0x1
popq %rax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/filedata.c
// Function: FileData_destroy
SOEXPORT void FileData_destroy(FileData *self)
{
    if (!self) return;
    Event_destroy(self->changedEvent);
    free(self->content);
    free(self);
}

// Assembly:
testq %rdi, %rdi
je 0x637b
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x5170
movq 0x18(%rbx), %rdi
callq 0x5080
movq %rbx, %rdi
popq %rbx
jmp 0x5080
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/hostfilereader.c
// Function: readHostFile
SOEXPORT FileData *readHostFile(FILE *file)
{
    uint8_t buf[RBUFSIZE];
    size_t nread;

    FileData *filedata = FileData_create();

    while ((nread = fread(buf, 1, RBUFSIZE, file)))
    {
	if (FileData_append(filedata, buf, nread) < 0)
	{
	    FileData_destroy(filedata);
	    return 0;
	}
    }

    return filedata;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %r14
callq 0x5520
movq %rax, %rbx
movq %rsp, %r15
pushq $0x1
popq %r12
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rcx
callq 0x5140
testq %rax, %rax
je 0x63d0
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x5760
testl %eax, %eax
jns 0x639c
movq %rbx, %rdi
callq 0x53f0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/d64writer.c
// Function: writeD64
SOEXPORT int writeD64(FILE *file, const D64 *d64)
{
    for (uint8_t tracknum = 1; tracknum <= D64_tracks(d64); ++tracknum)
    {
	const Track *track = D64_rtrack(d64, tracknum);
	for (uint8_t sectnum = 0; sectnum < Track_sectors(track); ++sectnum)
	{
	    const Sector *sector = Track_rsector(track, sectnum);
	    const uint8_t *content = Sector_rcontent(sector);
	    if (!fwrite(content, SECTOR_SIZE, 1, file))
            {
                logmsg(L_ERROR, "writeD64: unknown write error.");
                return -1;
            }
	}
    }
    logmsg(L_DEBUG, "writeD64: success.");
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movb $0x1, %bpl
pushq $0x1
popq %r15
movq %rbx, %rdi
callq 0x5620
cmpb %al, %bpl
ja 0x64bf
movzbl %bpl, %esi
movq %rbx, %rdi
callq 0x5060
movq %rax, %r12
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x5780
cmpb %al, %r13b
jae 0x6499
movzbl %r13b, %esi
movq %r12, %rdi
callq 0x54b0
movq %rax, %rdi
callq 0x56b0
movl $0x100, %esi            # imm = 0x100
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x5720
incb %r13b
testq %rax, %rax
jne 0x645b
jmp 0x649e
incb %bpl
jmp 0x643c
leaq 0x7138(%rip), %rsi      # 0xd5dd
pushq $0x1
popq %rdi
callq 0x5960
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x7136(%rip), %rsi      # 0xd5fc
pushq $0x4
popq %rdi
callq 0x5960
xorl %eax, %eax
jmp 0x64b0
nop
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/filename.c
// Function: Filename_clone
SOLOCAL Filename *Filename_clone(const Filename *self)
{
    Filename *clone = Filename_create();
    if (self->full) clone->full = copystr(self->full);
    if (self->dir) clone->dir = copystr(self->dir);
    if (self->base) clone->base = copystr(self->base);
    if (self->ext) clone->ext = copystr(self->ext);
    return clone;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x64d4
movq %rax, %rbx
movq (%r14), %rdi
testq %rdi, %rdi
je 0x6508
callq 0x58dc
movq %rax, (%rbx)
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x651a
callq 0x58dc
movq %rax, 0x8(%rbx)
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x652c
callq 0x58dc
movq %rax, 0x10(%rbx)
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x653e
callq 0x58dc
movq %rax, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/filename.c
// Function: Filename_setFull
SOLOCAL void Filename_setFull(Filename *self, const char *full)
{
    free(self->full);
    free(self->dir);
    free(self->base);
    free(self->ext);
    memset(self, 0, sizeof *self);
    if (!full) return;
    self->full = copystr(full);
#ifdef _WIN32
    for (char *c = self->full; *c; ++c)
    {
        if (*c == '/') *c = PATHSEP;
    }
#endif
    const char *pathsep = strrchr(self->full, PATHSEP);
    const char *base;
    if (pathsep)
    {
	size_t dirlen = pathsep - self->full;
	self->dir = xmalloc(dirlen + 1);
	strncpy(self->dir, self->full, dirlen);
	self->dir[dirlen] = 0;
	base = pathsep+1;
    }
    else
    {
	base = self->full;
    }

    const char *extsep = *base ? strrchr(base, '.') : 0;
    if (extsep)
    {
	self->ext = copystr(extsep+1);
	size_t baselen = extsep - base;
	self->base = xmalloc(baselen + 1);
	strncpy(self->base, base, baselen);
	self->base[baselen] = 0;
    }
    else
    {
	self->base = *base ? copystr(base) : 0;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x5080
movq 0x8(%rbx), %rdi
callq 0x5080
movq 0x10(%rbx), %rdi
callq 0x5080
movq 0x18(%rbx), %rdi
callq 0x5080
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
testq %r14, %r14
je 0x6651
movq %r14, %rdi
callq 0x58dc
movq %rax, %r14
movq %rax, (%rbx)
pushq $0x2f
popq %rsi
movq %rax, %rdi
callq 0x52c0
testq %rax, %rax
je 0x65f2
movq %rax, %r15
movq %rax, %r12
subq %r14, %r12
leaq 0x1(%r12), %rdi
callq 0x589c
movq %rax, 0x8(%rbx)
movq (%rbx), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x50b0
movq 0x8(%rbx), %rax
movb $0x0, (%rax,%r12)
incq %r15
movq %r15, %r14
cmpb $0x0, (%r14)
je 0x6641
pushq $0x2e
popq %rsi
movq %r14, %rdi
callq 0x52c0
testq %rax, %rax
je 0x6645
movq %rax, %r15
leaq 0x1(%rax), %rdi
callq 0x58dc
movq %rax, 0x18(%rbx)
subq %r14, %r15
leaq 0x1(%r15), %rdi
callq 0x589c
movq %rax, 0x10(%rbx)
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x50b0
movq 0x10(%rbx), %rax
movb $0x0, (%rax,%r15)
jmp 0x6651
xorl %eax, %eax
jmp 0x664d
movq %r14, %rdi
callq 0x58dc
movq %rax, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/filename.c
// Function: Filename_updateFull
static void Filename_updateFull(Filename *self)
{
    free(self->full);
    if (!self->base)
    {
	self->full = 0;
	return;
    }
    size_t fulllen = strlen(self->base);
    if (self->dir) fulllen += strlen(self->dir) + 1;
    if (self->ext) fulllen += strlen(self->ext) + 1;
    self->full = xmalloc(fulllen+1);
    char *wrptr = self->full;
    if (self->dir)
    {
	strcpy(wrptr, self->dir);
	wrptr += strlen(self->dir);
	*wrptr++ = PATHSEP;
    }
    strcpy(wrptr, self->base);
    wrptr += strlen(self->base);
    if (self->ext)
    {
	*wrptr++ = '.';
	strcpy(wrptr, self->ext);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x5080
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x6741
callq 0x5260
movq %rax, %r14
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x66c0
callq 0x5260
addq %rax, %r14
incq %r14
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x66d4
callq 0x5260
addq %rax, %r14
incq %r14
incq %r14
movq %r14, %rdi
callq 0x589c
movq %rax, %r14
movq %rax, (%rbx)
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x670a
movq %r14, %rdi
callq 0x5100
movq 0x8(%rbx), %rdi
callq 0x5260
movb $0x2f, (%r14,%rax)
addq %rax, %r14
incq %r14
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x5100
cmpq $0x0, 0x18(%rbx)
je 0x6745
movq 0x10(%rbx), %rdi
callq 0x5260
leaq (%r14,%rax), %rdi
incq %rdi
movb $0x2e, -0x1(%rdi)
movq 0x18(%rbx), %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5100
andq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/filename.c
// Function: Filename_destroy
SOLOCAL void Filename_destroy(Filename *self)
{
    if (!self) return;
    free(self->full);
    free(self->dir);
    free(self->base);
    free(self->ext);
    free(self);
}

// Assembly:
testq %rdi, %rdi
je 0x67de
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x5080
movq 0x8(%rbx), %rdi
callq 0x5080
movq 0x10(%rbx), %rdi
callq 0x5080
movq 0x18(%rbx), %rdi
callq 0x5080
movq %rbx, %rdi
popq %rbx
jmp 0x5080
retq
nop
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/zcfileset.c
// Function: ZcFileSet_create
SOEXPORT ZcFileSet *ZcFileSet_create(ZcType type, const char *name)
{
    int count;
    switch (type)
    {
        case ZT_4PACK:
            count = 4;
            break;
        case ZT_5PACK:
            count = 5;
            break;
        case ZT_6PACK:
            count = 6;
            break;
        default:
            logmsg(L_ERROR, "ZcFileSet: invalid type.");
            return 0;
    }

    ZcFileSet *self = xmalloc(sizeof *self + count * sizeof *self->files);
    self->type = type;
    self->count = count;
    self->name = copystr(name);
    for (int i = 0; i < count; ++i) self->files[i] = FileData_create();
    return self;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x3, %edi
jae 0x6834
movq %rsi, %r14
movl %edi, %r15d
movl %edi, %r12d
orl $0x4, %r12d
leal 0x30(,%r15,8), %edi
callq 0x589c
movq %rax, %rbx
movl %r15d, (%rax)
movl %r12d, 0x4(%rax)
movq %r14, %rdi
callq 0x58dc
movq %rax, 0x8(%rbx)
xorl %r14d, %r14d
cmpq %r14, %r12
je 0x6845
callq 0x5520
movq %rax, 0x10(%rbx,%r14,8)
incq %r14
jmp 0x6820
leaq 0x6dd4(%rip), %rsi      # 0xd60f
pushq $0x1
popq %rdi
callq 0x5960
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/zcfileset.c
// Function: fromVfsInternal
static ZcFileSet *fromVfsInternal(const CbmdosVfs *vfs, int logerrors)
{
    logfmt(L_INFO, "ZcFileSet: checking disk `%s,%s'", CbmdosVfs_name(vfs, 0),
            CbmdosVfs_id(vfs, 0));

    const char *compare = 0;
    FileData *files[5] = { 0 };
    for (unsigned pos = 0; pos < CbmdosVfs_fileCount(vfs); ++pos)
    {
        const CbmdosFile *dosfile = CbmdosVfs_rfile(vfs, pos);
        if (CbmdosFile_type(dosfile) != CFT_PRG) continue;
        uint8_t namelen;
        const char *name = CbmdosFile_name(dosfile, &namelen);
        if (namelen < 3) continue;
        if (name[1] != '!' || name[2] == '!') continue;
        if (name[0] < '1' || name[0] > '5') continue;
        if (compare)
        {
            if (strcmp(name+2, compare)) continue;
        }
        else compare = name+2;
        int partidx = name[0] - '1';
        if (files[partidx])
        {
            logfmt(logerrors ? L_WARNING : L_INFO,
                    "ZcFileSet: skipping duplicate `%s.PRG'", name);
            continue;
        }
        files[partidx] = FileData_clone(CbmdosFile_rdata(dosfile));
        logfmt(L_INFO, "ZcFileSet: found `%s.PRG' (%lu bytes)", name,
                (unsigned long)FileData_size(files[partidx]));
    }

    return fromFileData(compare, files, logerrors);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebp
movq %rdi, %r14
xorl %esi, %esi
callq 0x5190
movq %rax, %rbx
movq %r14, %rdi
xorl %esi, %esi
callq 0x5400
leaq 0x6ec1(%rip), %rsi      # 0xd748
pushq $0x3
popq %rdi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x598d
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x40(%rsp)
movl %ebp, 0x1c(%rsp)
cmpl $0x1, %ebp
movl $0x0, %eax
adcl $0x2, %eax
movl %eax, 0x18(%rsp)
leaq 0xf(%rsp), %r12
xorl %ebp, %ebp
movq $0x0, 0x10(%rsp)
movq %r14, %rdi
callq 0x5250
cmpl %eax, %ebp
jae 0x69b5
movq %r14, %rdi
movl %ebp, %esi
callq 0x5350
movq %rax, %r15
movq %rax, %rdi
callq 0x57c0
cmpl $0x2, %eax
jne 0x69ae
movq %r15, %rdi
movq %r12, %rsi
callq 0x5370
cmpb $0x3, 0xf(%rsp)
jb 0x69ae
movq %rax, %rbx
cmpb $0x21, 0x1(%rax)
jne 0x69ae
cmpb $0x21, 0x2(%rbx)
je 0x69ae
movzbl (%rbx), %r13d
leal -0x36(%r13), %eax
cmpb $-0x5, %al
jb 0x69ae
movq %rbx, %rdi
addq $0x2, %rdi
movq 0x10(%rsp), %rsi
testq %rsi, %rsi
je 0x6950
callq 0x5430
testl %eax, %eax
jne 0x69ae
jmp 0x6955
movq %rdi, 0x10(%rsp)
cmpq $0x0, -0x168(%rsp,%r13,8)
je 0x6977
movl 0x18(%rsp), %edi
leaq 0x6dfe(%rip), %rsi      # 0xd769
movq %rbx, %rdx
xorl %eax, %eax
callq 0x598d
jmp 0x69ae
movq %r15, %rdi
callq 0x5180
movq %rax, %rdi
callq 0x5150
movq %rax, -0x168(%rsp,%r13,8)
movq %rax, %rdi
callq 0x5530
pushq $0x3
popq %rdi
leaq 0x6def(%rip), %rsi      # 0xd790
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x598d
incl %ebp
jmp 0x68cd
leaq 0x20(%rsp), %rsi
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %edx
callq 0x6c5e
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/zcfileset.c
// Function: fromFileDataInternal
static ZcFileSet *fromFileDataInternal(const FileData *file, int logerrors)
{
    D64 *d64 = readD64FromFileData(file);
    if (!d64) return 0;
    CbmdosVfs *vfs = CbmdosVfs_create();
    int rc = readCbmdosVfs(vfs, d64, 0);
    D64_destroy(d64);
    if (rc < 0)
    {
        CbmdosVfs_destroy(vfs);
        return 0;
    }
    ZcFileSet *self = fromVfsInternal(vfs, logerrors);
    CbmdosVfs_destroy(vfs);
    return self;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
callq 0x5210
testq %rax, %rax
je 0x6a37
movq %rax, %r12
callq 0x5550
movq %rax, %r15
xorl %r14d, %r14d
movq %rax, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x52d0
movl %eax, %ebp
movq %r12, %rdi
callq 0x55e0
testl %ebp, %ebp
js 0x6a2d
movq %r15, %rdi
movl %ebx, %esi
callq 0x6859
movq %rax, %r14
movq %r15, %rdi
callq 0x54c0
jmp 0x6a3a
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq