LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x5cff
movl (%rdi), %eax
leaq 0x8455(%rip), %rcx      # 0xe14e
cmpb %sil, (%rax,%rcx)
jae 0x5d1a
movzbl %sil, %edx
leaq 0x83e3(%rip), %rsi      # 0xe0ed
xorl %ebx, %ebx
movl $0x2, %edi
xorl %eax, %eax
callq 0x5949
jmp 0x5d25
movzbl %sil, %eax
decl %eax
movq 0x8(%rdi,%rax,8), %rbx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5d3e
movl (%rdi), %eax
leaq 0x8416(%rip), %rcx      # 0xe14e
cmpb %sil, (%rax,%rcx)
jae 0x5d59
movzbl %sil, %edx
leaq 0x83d5(%rip), %rsi      # 0xe11e
xorl %ebx, %ebx
movl $0x2, %edi
xorl %eax, %eax
callq 0x5949
jmp 0x5d64
movzbl %sil, %eax
decl %eax
movq 0x8(%rdi,%rax,8), %rbx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5de0
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
leaq 0x8394(%rip), %r15      # 0xe14e
movq 0x8(%rbx,%r14,8), %rdi
callq 0x55d0
incq %r14
movl (%rbx), %eax
movzbl (%rax,%r15), %eax
cmpq %rax, %r14
jb 0x5dba
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x5080
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x20, %edi
callq 0x585c
movq %rax, %rbx
movl $0x400, %edi            # imm = 0x400
callq 0x585c
movq %rax, 0x18(%rbx)
movq $0x0, (%rbx)
movq $0x400, 0x8(%rbx)       # imm = 0x400
xorl %edi, %edi
movq %rbx, %rsi
callq 0x5270
movq %rax, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x20, %edi
callq 0x585c
movq %rax, %r14
movq (%rbx), %rax
movq %rax, (%r14)
movq 0x8(%rbx), %rdi
movq %rdi, 0x8(%r14)
callq 0x585c
movq %rax, 0x18(%r14)
xorl %edi, %edi
movq %r14, %rsi
callq 0x5270
movq %rax, 0x10(%r14)
movq 0x18(%r14), %rdi
movq (%rbx), %rdx
movq 0x18(%rbx), %rsi
callq 0x5470
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rdx, %rbx
movq %rsi, %r15
movq (%rdi), %rcx
movq %rcx, %rdx
addq %rbx, %rdx
setb %al
cmpq $0x100001, %rdx         # imm = 0x100001
setae %sil
orb %al, %sil
je 0x622e
leaq 0x831b(%rip), %rsi      # 0xe538
movl $0x1, %edi
callq 0x591c
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x6283
movq %rdi, %r14
movq 0x8(%rdi), %rsi
movq 0x18(%rdi), %rax
cmpq %rsi, %rdx
jbe 0x6262
addq $0x400, %rsi            # imm = 0x400
movq %rsi, 0x8(%r14)
movq %rax, %rdi
callq 0x587c
movq %rax, 0x18(%r14)
movq (%r14), %rcx
movq 0x8(%r14), %rsi
leaq (%rcx,%rbx), %rdx
jmp 0x6239
addq %rcx, %rax
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x5470
addq %rbx, (%r14)
movq 0x10(%r14), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x55e0
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x62b4
leaq 0x82bd(%rip), %rsi      # 0xe560
movl $0x1, %edi
callq 0x591c
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x62f6
movq %rdi, %rbx
cmpq 0x8(%rdi), %rsi
jne 0x62da
addq $0x400, %rsi            # imm = 0x400
movq %rsi, 0x8(%rbx)
movq 0x18(%rbx), %rdi
callq 0x587c
movq %rax, 0x18(%rbx)
movq (%rbx), %rsi
jmp 0x62de
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 0x55e0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rdx, %rbx
movl %esi, %ebp
movq (%rdi), %rcx
movq %rcx, %rdx
addq %rbx, %rdx
setb %al
cmpq $0x100001, %rdx         # imm = 0x100001
setae %sil
orb %al, %sil
je 0x633c
leaq 0x8261(%rip), %rsi      # 0xe58c
movl $0x1, %edi
callq 0x591c
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x6392
movq %rdi, %r14
movq 0x8(%rdi), %rsi
movq 0x18(%rdi), %rax
cmpq %rsi, %rdx
jbe 0x6370
addq $0x400, %rsi            # imm = 0x400
movq %rsi, 0x8(%r14)
movq %rax, %rdi
callq 0x587c
movq %rax, 0x18(%r14)
movq (%r14), %rcx
movq 0x8(%r14), %rsi
leaq (%rcx,%rbx), %rdx
jmp 0x6347
addq %rcx, %rax
movzbl %bpl, %esi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x5320
addq %rbx, (%r14)
movq 0x10(%r14), %rdi
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x55e0
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x63a9
movq 0x18(%rdi), %rax
movb %sil, (%rax,%rdx)
xorl %eax, %eax
retq
pushq %rax
leaq 0x8208(%rip), %rsi      # 0xe5b9
movl $0x1, %edi
callq 0x591c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x63ee
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
nop
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rdi, %r14
callq 0x54f0
movq %rax, %rbx
movq %rsp, %r15
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
movq %r14, %rcx
callq 0x5140
testq %rax, %rax
je 0x6440
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x5720
testl %eax, %eax
jns 0x640a
movq %rbx, %rdi
callq 0x53d0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x55f0
testb %al, %al
je 0x651d
movb $0x1, %bpl
movzbl %bpl, %esi
movq %rbx, %rdi
callq 0x5060
movq %rax, %r15
movq %rax, %rdi
callq 0x5740
testb %al, %al
je 0x650d
xorl %r12d, %r12d
movzbl %r12b, %esi
movq %r15, %rdi
callq 0x5480
movq %rax, %rdi
callq 0x5670
movl $0x100, %esi            # imm = 0x100
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rcx
callq 0x56e0
testq %rax, %rax
je 0x6532
incb %r12b
movq %r15, %rdi
callq 0x5740
cmpb %al, %r12b
jb 0x64cf
incb %bpl
movq %rbx, %rdi
callq 0x55f0
cmpb %al, %bpl
jbe 0x64b1
leaq 0x80d8(%rip), %rsi      # 0xe5fc
movl $0x4, %edi
callq 0x591c
xorl %eax, %eax
jmp 0x6548
leaq 0x80a4(%rip), %rsi      # 0xe5dd
movl $0x1, %edi
callq 0x591c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x20, %edi
callq 0x585c
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movq (%r14), %rdi
testq %rdi, %rdi
je 0x6599
callq 0x589c
movq %rax, (%rbx)
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x65ab
callq 0x589c
movq %rax, 0x8(%rbx)
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x65bd
callq 0x589c
movq %rax, 0x10(%rbx)
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x65cf
callq 0x589c
movq %rax, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x66e6
movq %r14, %rdi
callq 0x589c
movq %rax, %r14
movq %rax, (%rbx)
movq %rax, %rdi
movl $0x2f, %esi
callq 0x52b0
testq %rax, %rax
je 0x6685
movq %rax, %r15
movq %rax, %r12
subq %r14, %r12
leaq 0x1(%r12), %rdi
callq 0x585c
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 0x66d6
movq %r14, %rdi
movl $0x2e, %esi
callq 0x52b0
testq %rax, %rax
je 0x66da
movq %rax, %r15
leaq 0x1(%rax), %rdi
callq 0x589c
movq %rax, 0x18(%rbx)
subq %r14, %r15
leaq 0x1(%r15), %rdi
callq 0x585c
movq %rax, 0x10(%rbx)
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x50b0
movq 0x10(%rbx), %rax
movb $0x0, (%rax,%r15)
jmp 0x66e6
xorl %eax, %eax
jmp 0x66e2
movq %r14, %rdi
callq 0x589c
movq %rax, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x67d6
callq 0x5250
movq %rax, %r14
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x6755
callq 0x5250
addq %rax, %r14
incq %r14
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x6769
callq 0x5250
addq %rax, %r14
incq %r14
incq %r14
movq %r14, %rdi
callq 0x585c
movq %rax, %r14
movq %rax, (%rbx)
movq 0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x679f
movq %r14, %rdi
callq 0x5100
movq 0x8(%rbx), %rdi
callq 0x5250
movb $0x2f, (%r14,%rax)
addq %rax, %r14
incq %r14
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x5100
cmpq $0x0, 0x18(%rbx)
je 0x67dd
movq 0x10(%rbx), %rdi
callq 0x5250
leaq (%r14,%rax), %rdi
incq %rdi
movb $0x2e, -0x1(%rdi)
movq 0x18(%rbx), %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5100
movq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x6876
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_O3/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 0x68cc
movq %rsi, %r14
movl %edi, %r15d
movl %edi, %r12d
orl $0x4, %r12d
leal 0x30(,%r15,8), %edi
callq 0x585c
movq %rax, %rbx
movl %r15d, (%rax)
movl %r12d, 0x4(%rax)
movq %r14, %rdi
callq 0x589c
movq %rax, 0x8(%rbx)
xorl %r14d, %r14d
callq 0x54f0
movq %rax, 0x10(%rbx,%r14,8)
incq %r14
cmpq %r14, %r12
jne 0x68b8
jmp 0x68df
leaq 0x7d3c(%rip), %rsi      # 0xe60f
movl $0x1, %edi
callq 0x591c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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, 0xc(%rsp)
movq %rdi, %r14
xorl %esi, %esi
callq 0x5190
movq %rax, %rbx
movq %r14, %rdi
xorl %esi, %esi
callq 0x53e0
leaq 0x7e23(%rip), %rsi      # 0xe748
movl $0x3, %edi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x5949
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x40(%rsp)
movq %r14, %rdi
callq 0x5240
movl $0x0, %ecx
movq %rcx, 0x10(%rsp)
testl %eax, %eax
je 0x6a71
cmpl $0x1, 0xc(%rsp)
movl $0x0, %eax
adcl $0x2, %eax
movl %eax, 0x1c(%rsp)
leaq 0xb(%rsp), %r12
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movq %r14, %rdi
movl %r13d, %esi
callq 0x5340
movq %rax, %rbp
movq %rax, %rdi
callq 0x5780
cmpl $0x2, %eax
jne 0x6a5d
movq %rbp, %rdi
movq %r12, %rsi
callq 0x5360
cmpb $0x3, 0xb(%rsp)
jb 0x6a5d
movq %rax, %rbx
cmpb $0x21, 0x1(%rax)
jne 0x6a5d
cmpb $0x21, 0x2(%rbx)
je 0x6a5d
movzbl (%rbx), %r15d
leal -0x36(%r15), %eax
cmpb $-0x5, %al
jb 0x6a5d
movq %rbx, %rdi
addq $0x2, %rdi
movq 0x10(%rsp), %rsi
testq %rsi, %rsi
je 0x69fd
callq 0x5400
testl %eax, %eax
jne 0x6a5d
jmp 0x6a02
movq %rdi, 0x10(%rsp)
cmpq $0x0, -0x168(%rsp,%r15,8)
je 0x6a24
movl 0x1c(%rsp), %edi
leaq 0x7d51(%rip), %rsi      # 0xe769
movq %rbx, %rdx
xorl %eax, %eax
callq 0x5949
jmp 0x6a5d
movq %rbp, %rdi
callq 0x5180
movq %rax, %rdi
callq 0x5150
movq %rax, -0x168(%rsp,%r15,8)
movq %rax, %rdi
callq 0x5500
movl $0x3, %edi
leaq 0x7d40(%rip), %rsi      # 0xe790
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x5949
incl %r13d
movq %r14, %rdi
callq 0x5240
cmpl %eax, %r13d
jb 0x6989
leaq 0x20(%rsp), %rsi
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %edx
callq 0x6d30
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5200
testq %rax, %rax
je 0x6af5
movq %rax, %r12
callq 0x5520
movq %rax, %r15
xorl %r14d, %r14d
movq %rax, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x52c0
movl %eax, %ebp
movq %r12, %rdi
callq 0x55b0
testl %ebp, %ebp
js 0x6aeb
movq %r15, %rdi
movl %ebx, %esi
callq 0x68f5
movq %rax, %r14
movq %r15, %rdi
callq 0x5490
jmp 0x6af8
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/zcfileset.c
// Function: fromFileData
static ZcFileSet *fromFileData(
        const char *name, FileData **files, int logerrors)
{
    ZcFileSet *self = 0;

    if (files[0] && files[1] && files[2] && files[3])
    {
        if (files[4])
        {
            logmsg(L_INFO, "ZcFileSet: 5-file disk-packed zipcode "
                    "read successfully.");
            self = xmalloc(sizeof *self + 5 * sizeof *self->files);
            self->type = ZT_5PACK;
            self->count = 5;
            memcpy(self->files, files, 5 * sizeof *self->files);
        }
        else
        {
            logmsg(L_INFO, "ZcFileSet: 4-file disk-packed zipcode "
                    "read successfully.");
            self = xmalloc(sizeof *self + 4 * sizeof *self->files);
            self->type = ZT_4PACK;
            self->count = 4;
            memcpy(self->files, files, 4 * sizeof *self->files);
        }
        self->name = copystr(name);
    }
    else
    {
        if (logerrors)
        {
            logmsg(L_ERROR, "ZcFileSet: reading failed (missing or "
                    "unreadable files).");
        }
        for (int i = 0; i < 5; ++i) FileData_destroy(files[i]);
    }

    return self;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
cmpq $0x0, (%rsi)
je 0x6da3
cmpq $0x0, 0x8(%rbx)
je 0x6da3
cmpq $0x0, 0x10(%rbx)
je 0x6da3
cmpq $0x0, 0x18(%rbx)
je 0x6da3
movq %rdi, %r14
cmpq $0x0, 0x20(%rbx)
je 0x6dd9
leaq 0x7a52(%rip), %rsi      # 0xe7b6
movl $0x3, %edi
callq 0x591c
movl $0x38, %edi
callq 0x585c
movq %rax, %r15
movabsq $0x500000001, %rax      # imm = 0x500000001
movq %rax, (%r15)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm0, 0x10(%r15)
movups %xmm1, 0x20(%r15)
movq 0x20(%rbx), %rax
movq %rax, 0x30(%r15)
jmp 0x6e15
testl %edx, %edx
je 0x6db8
leaq 0x7a7a(%rip), %rsi      # 0xe828
movl $0x1, %edi
callq 0x591c
xorl %r15d, %r15d
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
callq 0x53d0
incq %r14
cmpq $0x5, %r14
jne 0x6dbe
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x7a0f(%rip), %rsi      # 0xe7ef
movl $0x3, %edi
callq 0x591c
movl $0x30, %edi
callq 0x585c
movq %rax, %r15
movabsq $0x400000000, %rax      # imm = 0x400000000
movq %rax, (%r15)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm0, 0x10(%r15)
movups %xmm1, 0x20(%r15)
movq %r14, %rdi
callq 0x589c
movq %rax, 0x8(%r15)
jmp 0x6dd0
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/zcfileset.c
// Function: ZcFileSet_saveVfs
SOEXPORT int ZcFileSet_saveVfs(const ZcFileSet *self, CbmdosVfs *vfs)
{
    char name[16];
    uint8_t baselen = strlen(self->name) > 14 ? 14 : strlen(self->name);
    memcpy(name+2, self->name, baselen);
    name[1] = '!';
    for (name[0] = '1'; name[0] < (self->type == ZT_5PACK ? '6' : '5');
	    ++name [0])
    {
	CbmdosFile *file = CbmdosFile_create();
	CbmdosFile_setName(file, name, baselen+2);
	FileData *cfd = CbmdosFile_data(file);
	const FileData *fd = self->files[name[0]-'1'];
	if (FileData_append(cfd, FileData_rcontent(fd), FileData_size(fd)) < 0)
	{
	    return -1;
	}
	if (CbmdosVfs_append(vfs, file))
	{
	    return -1;
	}
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, %r14
movq 0x8(%rdi), %r15
movq %r15, %rdi
callq 0x5250
cmpq $0xe, %rax
movl $0xe, %r12d
cmovbq %rax, %r12
leaq 0x2(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5470
movw $0x2131, -0x2(%r13)     # imm = 0x2131
leal 0x2(%r12), %eax
movzbl %al, %ebp
callq 0x5390
movq %rax, %r12
movq %rax, %rdi
movq %rsp, %rsi
movl %ebp, %edx
callq 0x52f0
movq %r12, %rdi
callq 0x5610
movq %rax, %r13
movsbq (%rsp), %rax
movq -0x178(%r14,%rax,8), %r15
movq %r15, %rdi
callq 0x5640
movq %rax, %rbx
movq %r15, %rdi
callq 0x5500
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x5720
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x7115
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x54b0
testl %eax, %eax
jne 0x7115
movb (%rsp), %al
incb %al
movb %al, (%rsp)
xorl %ecx, %ecx
cmpl $0x1, (%r14)
movsbl %al, %eax
sete %cl
addl $0x35, %ecx
cmpl %eax, %ecx
jg 0x708a
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/zcfileset.c
// Function: ZcFileSet_destroy
SOEXPORT void ZcFileSet_destroy(ZcFileSet *self)
{
    if (!self) return;
    free(self->name);
    for (int i = 0; i < self->count; ++i) FileData_destroy(self->files[i]);
    free(self);
}

// Assembly:
testq %rdi, %rdi
je 0x716a
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x5080
cmpl $0x0, 0x4(%rbx)
jle 0x715b
xorl %r14d, %r14d
movq 0x10(%rbx,%r14,8), %rdi
callq 0x53d0
incq %r14
movslq 0x4(%rbx), %rax
cmpq %rax, %r14
jl 0x7145
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5080
retq
nop
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/zc45extractor.c
// Function: extractZc45
SOEXPORT D64 *extractZc45(const ZcFileSet *fileset)
{
    if (!fileset) return 0;
    ZcType type = ZcFileSet_type(fileset);
    if (type != ZT_4PACK && type != ZT_5PACK)
    {
        logmsg(L_ERROR, "extractZc45: trying to extract something that isn't "
                "a 4 or 5 file disk Zippack.");
        return 0;
    }

    D64 *extracted = D64_create(type == ZT_4PACK ? D64_STANDARD : D64_40TRACK);
    for (int i = 0; i < (type == ZT_4PACK ? 4 : 5); ++i)
    {
	const FileData *fd = ZcFileSet_rfileData(fileset, i);
	if (zc45_read(extracted, sectorcount[i],
                    FileData_rcontent(fd), FileData_size(fd))
		!= sectorcount[i])
	{
            logfmt(L_ERROR, "extractZc45: extraction failed in part %d.", i+1);
	    D64_destroy(extracted);
	    return 0;
	}
    }

    logfmt(L_DEBUG, "extractZc45: %d-file zipcode successfully extracted.",
            type == ZT_4PACK ? 4 : 5);
    return extracted;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x725d
movq %rdi, %rbx
callq 0x54e0
cmpl $0x2, %eax
jb 0x71a6
leaq 0x774b(%rip), %rsi      # 0xe8e2
movl $0x1, %edi
callq 0x591c
jmp 0x725d
movl %eax, %ebp
movl %eax, %edi
callq 0x55c0
movq %rax, %r13
cmpl $0x1, %ebp
movl $0x5, %eax
sbbl $0x0, %eax
movq %rax, 0x8(%rsp)
leaq 0x77d7(%rip), %r15      # 0xe9a0
xorl %r12d, %r12d
movq %r13, 0x10(%rsp)
movq %rbx, %r14
movq %rbx, %rdi
movl %r12d, %esi
callq 0x5350
movq %rax, %r13
movl (%r15), %ebp
movq %rax, %rdi
callq 0x5640
movq %rax, %rbx
movq %r13, %rdi
movq 0x10(%rsp), %r13
callq 0x5500
movq %r13, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x5070
cmpl %ebp, %eax
jne 0x723c
incq %r12
addq $0x4, %r15
cmpq %r12, 0x8(%rsp)
movq %r14, %rbx
jne 0x71d1
leaq 0x7734(%rip), %rsi      # 0xe95d
movl $0x4, %edi
movq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x5949
jmp 0x7260
incl %r12d
leaq 0x76ec(%rip), %rsi      # 0xe932
movl $0x1, %edi
movl %r12d, %edx
xorl %eax, %eax
callq 0x5949
movq %r13, %rdi
callq 0x55b0
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfile.c
// Function: CbmdosFile_baseCreate
static CbmdosFile *CbmdosFile_baseCreate(CbmdosInode *inode)
{
    CbmdosFile *self = xmalloc(sizeof *self);
    memset(self, 0, sizeof *self);
    self->inode = inode;
    self->changedEvent = Event_create(0, self);
    self->type = CFT_PRG;
    self->invalidType = -1;
    self->closed = 1;
    self->forcedBlocks = 0xffff;
    self->recordLength = 254;
    CbmdosInode_attach(self->inode);
    Event_register(CbmdosInode_changedEvent(self->inode), self, inodeHandler);
    return self;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x30, %edi
callq 0x585c
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movups %xmm0, 0x20(%rax)
movq %r14, 0x10(%rax)
xorl %edi, %edi
movq %rax, %rsi
callq 0x5270
movq %rax, (%rbx)
movabsq $-0xfffffffe, %rax      # imm = 0xFFFFFFFF00000002
movq %rax, 0x18(%rbx)
movl $0x1, 0x24(%rbx)
movw $0xffff, 0x2e(%rbx)     # imm = 0xFFFF
movb $-0x2, 0x2d(%rbx)
movq 0x10(%rbx), %rdi
callq 0xb4d2
movq 0x10(%rbx), %rdi
callq 0x56c0
leaq 0x183(%rip), %rdx       # 0x7484
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5550
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfile.c
// Function: CbmdosFile_clone
SOEXPORT CbmdosFile *CbmdosFile_clone(const CbmdosFile *other)
{
    CbmdosFile *self = xmalloc(sizeof *self);
    self->type = other->type;
    self->invalidType = other->invalidType;
    self->locked = other->locked;
    self->closed = other->closed;
    self->autoMapToLc = 0;
    self->name = 0;
    self->inode = CbmdosInode_clone(other->inode);
    self->changedEvent = Event_create(0, self);
    self->nameLength = 0;
    self->recordLength = other->recordLength;
    self->forcedBlocks = other->forcedBlocks;
    uint8_t len;
    const char *name = CbmdosFile_name(other, &len);
    CbmdosFile_setName(self, name, len);
    self->autoMapToLc = other->autoMapToLc;
    CbmdosInode_attach(self->inode);
    Event_register(CbmdosInode_changedEvent(self->inode), self, inodeHandler);
    return self;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x30, %edi
callq 0x585c
movq %rax, %rbx
movups 0x18(%r14), %xmm0
movups %xmm0, 0x18(%rax)
movl $0x0, 0x28(%rax)
movq $0x0, 0x8(%rax)
movq 0x10(%r14), %rdi
callq 0xb375
movq %rax, 0x10(%rbx)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x5270
movq %rax, (%rbx)
movb $0x0, 0x2c(%rbx)
movb 0x2d(%r14), %al
movb %al, 0x2d(%rbx)
movzwl 0x2e(%r14), %eax
movw %ax, 0x2e(%rbx)
movzbl 0x2c(%r14), %edx
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x52f0
movl 0x28(%r14), %eax
movl %eax, 0x28(%rbx)
movq 0x10(%rbx), %rdi
callq 0xb4d2
movq 0x10(%rbx), %rdi
callq 0x56c0
leaq 0xe2(%rip), %rdx        # 0x7484
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5550
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfile.c
// Function: CbmdosFile_setName
SOEXPORT void CbmdosFile_setName(
	CbmdosFile *self, const char *name, uint8_t length)
{
    if (length > 16)
    {
        logmsg(L_WARNING, "CbmdosFile_setName: truncating long name.");
        length = 16;
    }
    free(self->name);
    if (name)
    {
        self->name = xmalloc(length+1);
        memcpy(self->name, name, length);
        self->name[length] = 0;
    }
    else
    {
        self->name = 0;
        if (length)
        {
            logmsg(L_WARNING, "CbmdosFile_setName: length > 0 given for empty "
                    "name.");
            length = 0;
        }
    }
    self->nameLength = length;
    if (self->autoMapToLc)
    {
	petscii_mapUpperGfxToLower(self->name, self->nameLength);
    }
    CbmdosFileEventArgs args = { CFE_NAMECHANGED };
    Event_raise(self->changedEvent, &args);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
cmpb $0x11, %r14b
jb 0x73f2
leaq 0x75f1(%rip), %rsi      # 0xe9d6
movl $0x2, %edi
callq 0x591c
movb $0x10, %r14b
movq 0x8(%rbx), %rdi
callq 0x5080
testq %r15, %r15
je 0x742d
leal 0x1(%r14), %eax
movzbl %al, %edi
callq 0x585c
movq %rax, 0x8(%rbx)
movzbl %r14b, %r12d
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5470
movq 0x8(%rbx), %rax
movb $0x0, (%rax,%r12)
jmp 0x744e
movq $0x0, 0x8(%rbx)
testb %r14b, %r14b
je 0x744b
leaq 0x75bf(%rip), %rsi      # 0xea00
movl $0x2, %edi
callq 0x591c
xorl %r14d, %r14d
movb %r14b, 0x2c(%rbx)
cmpl $0x0, 0x28(%rbx)
je 0x7465
movq 0x8(%rbx), %rdi
movzbl %r14b, %esi
callq 0x5760
leaq 0x4(%rsp), %rsi
movl $0x1, (%rsi)
movq (%rbx), %rdi
callq 0x55e0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfile.c
// Function: CbmdosFile_setType
SOEXPORT int CbmdosFile_setType(CbmdosFile *self, CbmdosFileType type)
{
    int rc = 0;
    int invalidType = -1;
    type &= 0xf;
    if (type < CFT_DEL || type > CFT_REL)
    {
        logmsg(L_WARNING, "CbmdosFile_setType: invalid type.");
	invalidType = type;
        type = CFT_DEL;
	rc = -1;
    }
    if (type == self->type && invalidType == self->invalidType) return rc;
    if ((self->invalidType < 0 && self->type == CFT_DEL) ||
	    (invalidType < 0 && type == CFT_DEL))
    {
	CbmdosFile_setData(self, FileData_create());
    }
    self->type = type;
    self->invalidType = invalidType;
    CbmdosFileEventArgs args = { CFE_TYPECHANGED };
    Event_raise(self->changedEvent, &args);
    return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
andl $0xf, %ebp
cmpl $0x5, %ebp
jb 0x74f1
leaq 0x74d8(%rip), %rsi      # 0xe9b4
movl $0x2, %edi
callq 0x591c
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
xorl %r15d, %r15d
jmp 0x74fc
xorl %r14d, %r14d
movl %ebp, %r15d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl 0x18(%rbx), %eax
movl 0x1c(%rbx), %ecx
movl %r15d, %edx
xorl %eax, %edx
movl %ebp, %esi
xorl %ecx, %esi
orl %edx, %esi
je 0x7557
testl %ecx, %ecx
sets %cl
testl %eax, %eax
sete %al
testb %cl, %al
jne 0x752c
testl %ebp, %ebp
setns %al
testl %r15d, %r15d
setne %cl
orb %al, %cl
jne 0x753d
callq 0x54f0
movq 0x10(%rbx), %rdi
movq %rax, %rsi
callq 0x51c0
movl %r15d, 0x18(%rbx)
movl %ebp, 0x1c(%rbx)
leaq 0x4(%rsp), %rsi
movl $0x0, (%rsi)
movq (%rbx), %rdi
callq 0x55e0
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfile.c
// Function: CbmdosFile_exportPC64
SOEXPORT int CbmdosFile_exportPC64(const CbmdosFile *self, FILE *file)
{
    uint8_t header[26] = "C64File";
    memcpy(header+8, self->name, self->nameLength);
    if (self->type == CFT_REL) header[25] = self->recordLength;
    if (fwrite(header, sizeof header, 1, file) != 1) return -1;
    return writeHostFile(CbmdosInode_rdata(self->inode), file);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movups 0x74ff(%rip), %xmm0     # 0xeada
leaq 0x8(%rsp), %rdi
movups %xmm0, 0x2(%rdi)
movaps 0x74e5(%rip), %xmm0     # 0xead0
movaps %xmm0, -0x8(%rdi)
movq 0x8(%r14), %rsi
movzbl 0x2c(%r14), %edx
callq 0x5470
cmpl $0x4, 0x18(%r14)
jne 0x760c
movb 0x2d(%r14), %al
movb %al, 0x19(%rsp)
movq %rsp, %rdi
movl $0x1a, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x56e0
cmpq $0x1, %rax
jne 0x7642
movq 0x10(%r14), %rdi
callq 0x5230
movq %rax, %rdi
movq %rbx, %rsi
addq $0x28, %rsp
popq %rbx
popq %r14
jmp 0x55a0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfile.c
// Function: CbmdosFile_import
SOEXPORT int CbmdosFile_import(CbmdosFile *self, FILE *file)
{
    FileData *data = readHostFile(file);
    if (!data) return -1;
    const uint8_t *content = FileData_rcontent(data);
    if (FileData_size(data) > 26 && !content[24]
	    && !memcmp(content, "C64File", sizeof "C64File"))
    {
	FileData *raw = FileData_create();
	if (!raw)
	{
	    FileData_destroy(data);
	    return -1;
	}
	if (FileData_append(raw, content+26, FileData_size(data)-26) < 0)
	{
	    FileData_destroy(raw);
	    FileData_destroy(data);
	    return -1;
	}
	CbmdosFile_setData(self, raw);
	CbmdosFile_setName(self, (const char *)content+8,
		strlen((const char *)content+8));
	CbmdosFile_setRecordLength(self, content[25] ? content[25] : 254);
	FileData_destroy(data);
    }
    else
    {
	CbmdosFile_setData(self, data);
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq %rsi, %rdi
callq 0x52d0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x76af
movq %rax, %rbx
movq %rax, %rdi
callq 0x5640
movq %rax, %r15
movq %rbx, %rdi
callq 0x5500
cmpq $0x1b, %rax
jb 0x76a1
cmpb $0x0, 0x18(%r15)
jne 0x76a1
movabsq $0x656c6946343643, %rax # imm = 0x656C6946343643
cmpq %rax, (%r15)
je 0x76c0
movq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x51c0
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x54f0
testq %rax, %rax
je 0x7749
movq %rax, %r12
leaq 0x1a(%r15), %r13
movq %rbx, %rdi
callq 0x5500
leaq -0x1a(%rax), %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x5720
testl %eax, %eax
js 0x7741
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0x51c0
movq %r15, %r12
addq $0x8, %r12
movq %r12, %rdi
callq 0x5250
movl $0xff, %ebp
andl %ebp, %eax
movq %r14, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x52f0
movzbl 0x19(%r15), %eax
testb %al, %al
movl $0xfe, %esi
cmovnel %eax, %esi
andl %ebp, %esi
movq %r14, %rdi
callq 0x5580
movq %rbx, %rdi
callq 0x53d0
jmp 0x76ad
movq %r12, %rdi
callq 0x53d0
movq %rbx, %rdi
callq 0x53d0
jmp 0x76af
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfile.c
// Function: CbmdosFile_setRecordLength
SOEXPORT int CbmdosFile_setRecordLength(CbmdosFile *self, uint8_t recordLength)
{
    if (recordLength > 254)
    {
        logmsg(L_WARNING, "CbmdosFile_setRecordLength: invalid length, "
                "max is 254.");
        return -1;
    }
    if (recordLength < 1)
    {
        logmsg(L_WARNING, "CbmdosFile_setRecordLength: invalid length, "
                "min is 1.");
        return -1;
    }
    self->recordLength = recordLength;
    CbmdosFileEventArgs ea = { CFE_RECORDLENGTHCHANGED };
    Event_raise(self->changedEvent, &ea);
    return 0;
}

// Assembly:
pushq %rax
testl %esi, %esi
je 0x776c
cmpl $0xff, %esi
jne 0x7784
leaq 0x72d3(%rip), %rsi      # 0xea3d
jmp 0x7773
leaq 0x7302(%rip), %rsi      # 0xea75
movl $0x2, %edi
callq 0x591c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x779d
movb %sil, 0x2d(%rdi)
leaq 0x4(%rsp), %rsi
movl $0x6, (%rsi)
movq (%rdi), %rdi
callq 0x55e0
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfile.c
// Function: CbmdosFile_getDirLine
SOEXPORT void CbmdosFile_getDirLine(const CbmdosFile *self, uint8_t *line)
{
    int blocklen = sprintf((char *)line, "%u", CbmdosFile_blocks(self));
    memset(line + blocklen, 0xa0, 28 - blocklen);
    memcpy(line + 6, self->name, self->nameLength);
    if (self->invalidType < 0)
    {
	memcpy(line + 24, CbmdosFileType_name(self->type), 3);
    }
    else
    {
	memcpy(line + 24, "?  ", 3);
    }
    line[5] = 0x22;
    uint8_t endidx = 6;
    int qclosed = 0;
    while (line[endidx] != 0xa0)
    {
	if (line[endidx] == 0x22) qclosed = 1;
	++endidx;
    }
    if (!qclosed) line[endidx] = 0x22;
    if (!self->closed) line[23] = 0x2a;
    if (self->locked) line[27] = 0x3c;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzwl 0x2e(%rdi), %eax
cmpw $-0x1, %ax
jne 0x7882
cmpl $0x0, 0x18(%r14)
je 0x7880
movq 0x10(%r14), %rdi
callq 0x5300
jmp 0x7882
xorl %eax, %eax
movzwl %ax, %edx
leaq 0x721f(%rip), %rsi      # 0xeaab
movq %rbx, %rdi
xorl %eax, %eax
callq 0x56d0
cltq
leaq (%rbx,%rax), %rdi
movl $0x1c, %ecx
subl %eax, %ecx
movslq %ecx, %rdx
movl $0xa0, %esi
callq 0x5320
leaq 0x6(%rbx), %rdi
movq 0x8(%r14), %rsi
movzbl 0x2c(%r14), %edx
callq 0x5470
leaq 0x18(%rbx), %rax
cmpl $0x0, 0x1c(%r14)
js 0x78d8
movb $0x20, 0x2(%rax)
movw $0x203f, (%rax)         # imm = 0x203F
jmp 0x78f3
movl 0x18(%r14), %ecx
leaq 0xc01d(%rip), %rdx      # 0x13900
movq (%rdx,%rcx,8), %rcx
movb 0x2(%rcx), %dl
movb %dl, 0x2(%rax)
movzwl (%rcx), %ecx
movw %cx, (%rax)
movb $0x22, 0x5(%rbx)
xorl %ecx, %ecx
movb $0x6, %al
movzbl %al, %eax
movzbl (%rbx,%rax), %edx
cmpl $0x22, %edx
je 0x7911
cmpl $0xa0, %edx
jne 0x7916
jmp 0x791a
movl $0x1, %ecx
incb %al
jmp 0x78fb
testl %ecx, %ecx
jne 0x7922
movb $0x22, (%rbx,%rax)
cmpl $0x0, 0x24(%r14)
jne 0x792d
movb $0x2a, 0x17(%rbx)
cmpl $0x0, 0x20(%r14)
je 0x7938
movb $0x3c, 0x1b(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfile.c
// Function: CbmdosFile_destroy
SOEXPORT void CbmdosFile_destroy(CbmdosFile *self)
{
    if (!self) return;
    free(self->name);
    Event_destroy(self->changedEvent);
    Event_unregister(CbmdosInode_changedEvent(self->inode), self, inodeHandler);
    CbmdosInode_detach(self->inode);
    CbmdosInode_tryDestroy(self->inode);
    free(self);
}

// Assembly:
testq %rdi, %rdi
je 0x7994
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x5080
movq (%rbx), %rdi
callq 0x5170
movq 0x10(%rbx), %rdi
callq 0x56c0
leaq -0x4ea(%rip), %rdx      # 0x7484
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5330
movq 0x10(%rbx), %rdi
callq 0xb4d6
movq 0x10(%rbx), %rdi
callq 0xb4f4
movq %rbx, %rdi
popq %rbx
jmp 0x5080
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/cbmdosvfs.c
// Function: CbmdosVfs_create
SOEXPORT CbmdosVfs *CbmdosVfs_create(void)
{
    CbmdosVfs *self = xmalloc(sizeof *self);
    memset(self, 0, sizeof *self);
    self->files = xmalloc(DIRCHUNKSIZE * sizeof *self->files);
    self->fileCapa = DIRCHUNKSIZE;
    self->dosver = 0x41;
    self->changedEvent = Event_create(0, self);
    return self;
}

// Assembly:
pushq %rbx
movl $0x38, %edi
callq 0x585c
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movl $0x480, %edi            # imm = 0x480
callq 0x585c
movq %rax, 0x18(%rbx)
movl $0x90, 0x2c(%rbx)
movb $0x41, 0x32(%rbx)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x5270
movq %rax, 0x20(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/cbmdosvfs.c
// Function: CbmdosVfs_setName
SOEXPORT void CbmdosVfs_setName(
	CbmdosVfs *self, const char *name, uint8_t length)
{
    if (length > 16)
    {
        logmsg(L_WARNING, "CbmdosVfs_setName: truncating long name.");
        length = 16;
    }
    free(self->name);
    if (name)
    {
        self->name = xmalloc(length+1);
        memcpy(self->name, name, length);
        self->name[length] = 0;
    }
    else
    {
        self->name = 0;
        if (length)
        {
            logmsg(L_WARNING, "CbmdosVfs_setName: length > 0 given for empty "
                    "name.");
            length = 0;
        }
    }
    self->nameLength = length;
    if (self->autoMapToLc)
    {
	petscii_mapUpperGfxToLower(self->name, self->nameLength);
    }
    CbmdosVfsEventArgs args = { .what = CVE_NAMECHANGED };
    Event_raise(self->changedEvent, &args);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
cmpb $0x11, %r14b
jb 0x7a4f
leaq 0x70be(%rip), %rsi      # 0xeb00
movl $0x2, %edi
callq 0x591c
movb $0x10, %r14b
movq (%rbx), %rdi
callq 0x5080
testq %r15, %r15
je 0x7a87
leal 0x1(%r14), %eax
movzbl %al, %edi
callq 0x585c
movq %rax, (%rbx)
movzbl %r14b, %r12d
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5470
movq (%rbx), %rax
movb $0x0, (%rax,%r12)
jmp 0x7aa7
movq $0x0, (%rbx)
testb %r14b, %r14b
je 0x7aa4
leaq 0x708f(%rip), %rsi      # 0xeb29
movl $0x2, %edi
callq 0x591c
xorl %r14d, %r14d
movb %r14b, 0x30(%rbx)
cmpl $0x0, 0x10(%rbx)
je 0x7abd
movq (%rbx), %rdi
movzbl %r14b, %esi
callq 0x5760
movq 0x71a4(%rip), %rax      # 0xec68
movq %rsp, %rsi
movq %rax, 0x10(%rsi)
movups 0x7186(%rip), %xmm0     # 0xec58
movaps %xmm0, (%rsi)
movq 0x20(%rbx), %rdi
callq 0x55e0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/excess-c64[P]lib1541img/src/lib/1541img/cbmdosvfs.c
// Function: CbmdosVfs_setId
SOEXPORT void CbmdosVfs_setId(CbmdosVfs *self, const char *id, uint8_t length)
{
    if (length > 5)
    {
        logmsg(L_WARNING, "CbmdosVfs_setId: truncating long id.");
        length = 5;
    }
    free(self->id);
    if (id)
    {
        self->id = xmalloc(length+1);
        memcpy(self->id, id, length);
        self->id[length] = 0;
    }
    else
    {
        self->id = 0;
        if (length)
        {
            logmsg(L_WARNING, "CbmdosVfs_setId: length > 0 given for empty "
                    "id.");
            length = 0;
        }
    }
    self->idLength = length;
    if (self->autoMapToLc)
    {
	petscii_mapUpperGfxToLower(self->id, self->idLength);
    }
    CbmdosVfsEventArgs args = { .what = CVE_IDCHANGED };
    Event_raise(self->changedEvent, &args);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
cmpb $0x6, %r14b
jb 0x7b27
leaq 0x7043(%rip), %rsi      # 0xeb5d
movl $0x2, %edi
callq 0x591c
movb $0x5, %r14b
movq 0x8(%rbx), %rdi
callq 0x5080
testq %r15, %r15
je 0x7b62
leal 0x1(%r14), %eax
movzbl %al, %edi
callq 0x585c
movq %rax, 0x8(%rbx)
movzbl %r14b, %r12d
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5470
movq 0x8(%rbx), %rax
movb $0x0, (%rax,%r12)
jmp 0x7b83
movq $0x0, 0x8(%rbx)
testb %r14b, %r14b
je 0x7b80
leaq 0x700c(%rip), %rsi      # 0xeb82
movl $0x2, %edi
callq 0x591c
xorl %r14d, %r14d
movb %r14b, 0x31(%rbx)
cmpl $0x0, 0x10(%rbx)
je 0x7b9a
movq 0x8(%rbx), %rdi
movzbl %r14b, %esi
callq 0x5760
movq 0x70af(%rip), %rax      # 0xec50
movq %rsp, %rsi
movq %rax, 0x10(%rsi)
movups 0x7091(%rip), %xmm0     # 0xec40
movaps %xmm0, (%rsi)
movq 0x20(%rbx), %rdi
callq 0x55e0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq