LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/event.c
// Function: Event_unregister
SOEXPORT void Event_unregister(
	Event *self, void *receiver, EventHandler handler)
{
    size_t pos;
    for (pos = 0; pos < self->size; ++pos)
    {
        if (self->handlers[pos].receiver == receiver
                && self->handlers[pos].handler == handler)
        {
            break;
        }
    }
    if (pos < self->size)
    {
        --self->size;
        if (pos < self->size)
        {
            memmove(self->handlers + pos, self->handlers + pos + 1,
                    (self->size - pos) * sizeof *self->handlers);
        }
    }
}

// Assembly:
movq %rdx, %rax
movq 0x10(%rdi), %rdx
xorl %r8d, %r8d
xorl %r9d, %r9d
cmpq %r9, %rdx
je 0x973c
movq 0x8(%rdi), %rcx
cmpq %rsi, (%rcx,%r8)
jne 0x9708
cmpq %rax, 0x8(%rcx,%r8)
je 0x9711
incq %r9
addq $0x10, %r8
jmp 0x96f2
leaq -0x1(%rdx), %rax
movq %rax, 0x10(%rdi)
cmpq %rax, %r9
jae 0x973c
leaq (%rcx,%r8), %rsi
addq $0x10, %rsi
addq %r8, %rcx
shlq $0x4, %rdx
subq %r8, %rdx
addq $-0x10, %rdx
movq %rcx, %rdi
jmp 0x5660
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: CbmdosFs_create
SOEXPORT CbmdosFs *CbmdosFs_create(CbmdosFsOptions options)
{
    if (validateOptions(options) < 0) return 0;
    CbmdosFs *self = xmalloc(sizeof *self);
    memset(self, 0, sizeof *self);
    D64Type d64Type = D64_STANDARD;
    if (options.flags & CFF_42TRACK) d64Type = D64_42TRACK;
    else if (options.flags & CFF_40TRACK) d64Type = D64_40TRACK;
    self->d64 = D64_create(d64Type);
    self->dir.capa = DIRCHUNK;
    self->dir.entries = xmalloc(DIRCHUNK * sizeof *self->dir.entries);
    self->vfs = CbmdosVfs_create();
    if (options.flags & CFF_PROLOGICDOSBAM)
    {
	CbmdosVfs_setDosver(self->vfs, 0x50);
    }
    self->options = options;
    self->bam[17][0] = 1;
    updateDir(self);
    updateBam(self);
    Event_register(CbmdosVfs_changedEvent(self->vfs), self, vfsChanged);
    return self;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x9869
testl %eax, %eax
js 0x985e
movq %r14, %r15
shrq $0x20, %r15
movl $0x3a0, %edi            # imm = 0x3A0
callq 0x589c
movq %rax, %rbx
movl $0x3a0, %edx            # imm = 0x3A0
movq %rax, %rdi
xorl %esi, %esi
callq 0x5330
movl %r14d, %eax
shrl $0x2, %eax
andl $0x1, %eax
testb $0x8, %r14b
pushq $0x2
popq %rdi
cmovel %eax, %edi
callq 0x55f0
movq %rax, (%rbx)
movl $0x90, 0x1c(%rbx)
movl $0x360, %edi            # imm = 0x360
callq 0x589c
movq %rax, 0x10(%rbx)
callq 0x5550
movq %rax, 0x8(%rbx)
testb $0x40, %r14b
je 0x9822
pushq $0x50
popq %rsi
movq %rax, %rdi
callq 0x5630
movl %r14d, 0x24(%rbx)
movl %r15d, 0x28(%rbx)
movb $0x1, 0x191(%rbx)
movq %rbx, %rdi
callq 0x98d6
movq %rbx, %rdi
callq 0x9b77
movq 0x8(%rbx), %rdi
callq 0x51f0
leaq 0x482(%rip), %rdx       # 0x9cd3
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5580
jmp 0x9860
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: validateOptions
static int validateOptions(CbmdosFsOptions options)
{
    if ((options.flags & (CFF_SPEEDDOSBAM | CFF_DOLPHINDOSBAM))
	    && (options.flags & CFF_PROLOGICDOSBAM))
    {
	logmsg(L_ERROR, "Cannot combine Prologic DOS extended BAM with any "
		"other extended BAM formats.");
	return -1;
    }
    if ((options.flags & CFF_TALLOC_TRACKLOAD)
	    && (options.flags & CFF_TALLOC_SIMPLE))
    {
	logmsg(L_ERROR, "Cannot combine `trackload' track allocation strategy "
		"with `simple' track allocation strategy.");
	return -1;
    }
    if (options.dirInterleave < 1 || options.dirInterleave > 20
            || options.fileInterleave < 1 || options.fileInterleave > 20)
    {
        logmsg(L_ERROR, "Cannot set interleave values outside the range from "
                "1 to 20.");
        return -1;
    }
    return 0;
}

// Assembly:
testb $0x30, %dil
setne %al
movl %edi, %ecx
andl $0x40, %ecx
shrl $0x6, %ecx
testb %cl, %al
jne 0x988f
movl %edi, %eax
notl %eax
testw $0xc00, %ax             # imm = 0xC00
jne 0x98a7
leaq 0x4a92(%rip), %rsi      # 0xe31f
jmp 0x9896
leaq 0x4a3b(%rip), %rsi      # 0xe2d1
pushq %rax
pushq $0x1
popq %rdi
callq 0x5960
pushq $-0x1
popq %rax
addq $0x8, %rsp
retq
movq %rdi, %rcx
shrq $0x20, %rcx
movl $0xff, %eax
andl %eax, %ecx
addl $-0x15, %ecx
leaq 0x4abe(%rip), %rsi      # 0xe37d
cmpl $-0x14, %ecx
jb 0x9896
shrq $0x28, %rdi
andl %eax, %edi
addl $-0x15, %edi
xorl %eax, %eax
cmpl $-0x15, %edi
ja 0x98a6
jmp 0x9896
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: updateBam
static void updateBam(CbmdosFs *self)
{
    uint8_t *bam = Sector_content(D64_sector(self->d64, 18, 0));
    memset(bam, 0, 256);
    bam[0] = 18;
    bam[1] = 1;
    bam[2] = CbmdosVfs_dosver(self->vfs);
    for (uint8_t trackno = 1; trackno <= D64_tracks(self->d64); ++trackno)
    {
        if (trackno < 36)
        {
            createTrackBam(self, bam + 4*trackno, trackno);
        }
        else if (trackno < 41)
        {
            if (self->options.flags & CFF_DOLPHINDOSBAM)
            {
                createTrackBam(self, bam + 0x1c + 4*trackno, trackno);
            }
            if (self->options.flags & CFF_SPEEDDOSBAM)
            {
                createTrackBam(self, bam + 0x30 + 4*trackno, trackno);
            }
            if (self->options.flags & CFF_PROLOGICDOSBAM)
            {
                createTrackBam(self, bam + 4*trackno, trackno);
            }
        }
    }
    uint8_t nameoffset = 0;
    if (self->options.flags & CFF_PROLOGICDOSBAM) nameoffset = 0x14;
    memset(bam+0x90+nameoffset, 0xa0, 0x1b);
    bam[0xa5+nameoffset] = 0x32;
    bam[0xa6+nameoffset] = CbmdosVfs_dosver(self->vfs);
    uint8_t length;
    const char *name = CbmdosVfs_name(self->vfs, &length);
    memcpy(bam+0x90+nameoffset, name, length);
    const char *id = CbmdosVfs_id(self->vfs, &length);
    memcpy(bam+0xa2+nameoffset, id, length);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rdi), %rdi
pushq $0x12
popq %rsi
xorl %edx, %edx
callq 0x5030
movq %rax, %rdi
callq 0x56d0
movq %rax, %r14
leaq 0x2(%rax), %rdi
movl $0xfe, %edx
xorl %esi, %esi
callq 0x5330
movw $0x112, (%r14)          # imm = 0x112
movq 0x8(%rbx), %rdi
callq 0x5590
movb %al, 0x2(%r14)
leaq 0x1c(%r14), %rax
movq %rax, 0x10(%rsp)
leaq 0x30(%r14), %r12
movb $0x1, %r13b
movq (%rbx), %rdi
callq 0x5620
cmpb %al, %r13b
ja 0x9c3e
movzbl %r13b, %ebp
movl %ebp, %r15d
cmpb $0x24, %r13b
jae 0x9bfd
leaq (%r14,%r15,4), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0xab6e
jmp 0x9c39
cmpb $0x28, %r13b
ja 0x9c39
movl 0x24(%rbx), %eax
testb $0x10, %al
je 0x9c20
movq 0x10(%rsp), %rax
leaq (%rax,%r15,4), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0xab6e
movl 0x24(%rbx), %eax
testb $0x20, %al
je 0x9c35
leaq (%r12,%r15,4), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0xab6e
movl 0x24(%rbx), %eax
testb $0x40, %al
jne 0x9bed
incb %r13b
jmp 0x9bd3
leaq 0x14(%r14), %r15
testb $0x40, 0x24(%rbx)
cmoveq %r14, %r15
leaq 0x90(%r15), %r14
movaps 0x3e98(%rip), %xmm0     # 0xdaf0
movups %xmm0, 0x9b(%r15)
movups %xmm0, 0x90(%r15)
movb $0x32, 0xa5(%r15)
movq 0x8(%rbx), %rdi
callq 0x5590
movb %al, 0xa6(%r15)
movq 0x8(%rbx), %rdi
leaq 0xf(%rsp), %r12
movq %r12, %rsi
callq 0x5190
movzbl (%r12), %edx
movq %r14, %rdi
movq %rax, %rsi
callq 0x54a0
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x5400
addq $0xa2, %r15
movzbl (%r12), %edx
movq %r15, %rdi
movq %rax, %rsi
callq 0x54a0
addq $0x18, %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/cbmdosfs.c
// Function: CbmdosFs_destroy
SOEXPORT void CbmdosFs_destroy(CbmdosFs *self)
{
    if (!self) return;
    free(self->dir.entries);
    CbmdosVfs_destroy(self->vfs);
    D64_destroy(self->d64);
    free(self);
}

// Assembly:
testq %rdi, %rdi
je 0xa0d0
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x5080
movq 0x8(%rbx), %rdi
callq 0x54c0
movq (%rbx), %rdi
callq 0x55e0
movq %rbx, %rdi
popq %rbx
jmp 0x5080
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: CbmdosFs_fromVfs
SOEXPORT CbmdosFs *CbmdosFs_fromVfs(CbmdosVfs *vfs, CbmdosFsOptions options)
{
    if (validateOptions(options) < 0) return 0;
    CbmdosFs *self = xmalloc(sizeof *self);
    memset(self, 0, sizeof *self);
    self->dir.capa = DIRCHUNK;
    self->dir.size = CbmdosVfs_fileCount(vfs);
    while (self->dir.capa < self->dir.size)
    {
	self->dir.capa += DIRCHUNK;
    }
    self->dir.entries = xmalloc(self->dir.capa * sizeof *self->dir.entries);
    if ((options.flags & CFF_PROLOGICDOSBAM)
	    && CbmdosVfs_dosver(vfs) == 0x41)
    {
	CbmdosVfs_setDosver(vfs, 0x50);
    }
    self->vfs = vfs;
    self->options = options;
    if (CbmdosFs_rewrite(self) < 0)
    {
	self->vfs = 0;
	CbmdosFs_destroy(self);
	return 0;
    }
    Event_register(CbmdosVfs_changedEvent(self->vfs), self, vfsChanged);
    return self;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x9869
testl %eax, %eax
js 0xa1a4
movq %r14, %r12
shrq $0x20, %r12
movl $0x3a0, %edi            # imm = 0x3A0
callq 0x589c
movq %rax, %rbx
movl $0x3a0, %edx            # imm = 0x3A0
movq %rax, %rdi
xorl %esi, %esi
callq 0x5330
movl $0x90, 0x1c(%rbx)
movq %r15, %rdi
callq 0x5250
movl %eax, 0x18(%rbx)
movl 0x1c(%rbx), %ecx
cmpl %eax, %ecx
jae 0xa136
addl $0x90, %ecx
movl %ecx, 0x1c(%rbx)
jmp 0xa127
movl %ecx, %eax
imulq $0x6, %rax, %rdi
callq 0x589c
movq %rax, 0x10(%rbx)
testb $0x40, %r14b
je 0xa162
movq %r15, %rdi
callq 0x5590
cmpb $0x41, %al
jne 0xa162
pushq $0x50
popq %rsi
movq %r15, %rdi
callq 0x5630
movq %r15, 0x8(%rbx)
movl %r14d, 0x24(%rbx)
movl %r12d, 0x28(%rbx)
movq %rbx, %rdi
callq 0x57b0
testl %eax, %eax
js 0xa197
movq 0x8(%rbx), %rdi
callq 0x51f0
leaq -0x4b7(%rip), %rdx      # 0x9cd3
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5580
jmp 0xa1a6
andq $0x0, 0x8(%rbx)
movq %rbx, %rdi
callq 0x5490
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/cbmdosfs.c
// Function: CbmdosFs_rewrite
SOEXPORT int CbmdosFs_rewrite(CbmdosFs *self)
{
    D64_destroy(self->d64);
    D64Type d64Type = D64_STANDARD;
    if (self->options.flags & CFF_42TRACK) d64Type = D64_42TRACK;
    else if (self->options.flags & CFF_40TRACK) d64Type = D64_40TRACK;
    self->d64 = D64_create(d64Type);
    self->status = CFS_OK;
    memset(self->dir.entries, 0, self->dir.size * sizeof *self->dir.entries);
    memset(self->bam, 0, sizeof self->bam);
    self->bam[17][0] = 1;
    if (updateDir(self) < 0)
    {
	self->status |= CFS_DIRFULL;
	return -1;
    }
    for (unsigned pos = 0; pos < self->dir.size; ++pos)
    {
	if (updateFile(self, pos) < 0)
	{
	    self->status |= CFS_DISKFULL;
	    return -1;
	}
    }
    updateDir(self);
    updateBam(self);
    return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x55e0
movl 0x24(%rbx), %eax
movl %eax, %ecx
shrl $0x2, %ecx
andl $0x1, %ecx
testb $0x8, %al
pushq $0x2
popq %rdi
cmovel %ecx, %edi
callq 0x55f0
movq %rax, (%rbx)
andl $0x0, 0x20(%rbx)
movq 0x10(%rbx), %rdi
movl 0x18(%rbx), %eax
imulq $0x6, %rax, %rdx
xorl %ebp, %ebp
xorl %esi, %esi
callq 0x5330
leaq 0x2c(%rbx), %rdi
movl $0x372, %edx            # imm = 0x372
xorl %esi, %esi
callq 0x5330
movb $0x1, 0x191(%rbx)
movq %rbx, %rdi
callq 0x98d6
testl %eax, %eax
js 0xa234
cmpl 0x18(%rbx), %ebp
jae 0xa23d
movq %rbx, %rdi
movl %ebp, %esi
callq 0xa314
incl %ebp
testl %eax, %eax
jns 0xa219
orb $0x2, 0x20(%rbx)
jmp 0xa238
orb $0x4, 0x20(%rbx)
pushq $-0x1
popq %rax
jmp 0xa24f
movq %rbx, %rdi
callq 0x98d6
movq %rbx, %rdi
callq 0x9b77
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: CbmdosFs_setOptions
SOEXPORT int CbmdosFs_setOptions(CbmdosFs *self, CbmdosFsOptions options)
{
    int needRewrite = CbmdosFs_optionsWillRewrite(self, options);
    if (needRewrite < 0) return -1;
    CbmdosFsFlags changedFlags = self->options.flags ^ options.flags;
    self->options = options;
    if (needRewrite)
    {
        CbmdosFs_rewrite(self);
        return 1;
    }
    else if (changedFlags & (CFF_SPEEDDOSBAM|CFF_DOLPHINDOSBAM
                |CFF_PROLOGICDOSBAM|CFF_ZEROFREE))
    {
        updateBam(self);
        return 1;
    }
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x5730
testl %eax, %eax
js 0xa293
movl 0x24(%rbx), %eax
movq %r14, 0x24(%rbx)
je 0xa297
movq %rbx, %rdi
callq 0x57b0
jmp 0xa2a6
pushq $-0x1
jmp 0xa2a8
xorl %r14d, %eax
testb $-0x10, %al
je 0xa2b1
movq %rbx, %rdi
callq 0x9b77
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %eax, %eax
jmp 0xa2a9
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: CbmdosFs_optionsWillRewrite
SOEXPORT int CbmdosFs_optionsWillRewrite(
	const CbmdosFs *self, CbmdosFsOptions options)
{
    if (validateOptions(options) < 0) return -1;
    CbmdosFsFlags changedFlags = self->options.flags ^ options.flags;
    if (changedFlags & (
		CFF_FILESONDIRTRACK|CFF_ALLOWLONGDIR|CFF_42TRACK|
		CFF_SIMPLEINTERLEAVE|CFF_TALLOC_TRACKLOAD|CFF_TALLOC_SIMPLE|
		CFF_TALLOC_PREFDIRTRACK|CFF_TALLOC_CHAININTERLV))
    {
	return 1;
    }
    if (!(self->options.flags & CFF_42TRACK) && (changedFlags & CFF_40TRACK))
    {
        return 1;
    }
    if (options.dirInterleave != self->options.dirInterleave) return 1;
    if (options.fileInterleave != self->options.fileInterleave) return 1;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x9869
testl %eax, %eax
js 0xa309
movl 0x24(%r14), %edx
movl %edx, %ecx
xorl %ebx, %ecx
pushq $0x1
popq %rax
testw $0x3e0b, %cx            # imm = 0x3E0B
jne 0xa30c
testb $0x8, %dl
sete %dl
andl $0x4, %ecx
shrl $0x2, %ecx
testb %cl, %dl
jne 0xa30c
movq %rbx, %rcx
shrq $0x20, %rcx
cmpb %cl, 0x28(%r14)
jne 0xa30c
shrq $0x28, %rbx
xorl %eax, %eax
cmpb %bl, 0x29(%r14)
setne %al
jmp 0xa30c
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: CbmdosFs_freeBlocks
SOEXPORT uint16_t CbmdosFs_freeBlocks(const CbmdosFs *self)
{
    uint16_t free = 664;
    if (self->options.flags & CFF_42TRACK)
    {
	free += 119;
    }
    else if (self->options.flags & CFF_40TRACK)
    {
	free += 85;
    }
    unsigned filecount = CbmdosVfs_fileCount(self->vfs);
    if (filecount > 144)
    {
	if (!(self->options.flags & CFF_ALLOWLONGDIR)) return 0xffff;
	unsigned extrafiles = filecount - 144;
	unsigned dirblocks = extrafiles / 8;
	if (extrafiles % 8) ++dirblocks;
	if (dirblocks > free) return 0xffff;
	free -= dirblocks;
    }
    else if (self->options.flags & CFF_FILESONDIRTRACK)
    {
	unsigned freefiles = 144 - filecount;
	unsigned freedirblocks = freefiles / 8;
	free += freedirblocks;
    }
    for (unsigned n = 0; n < filecount; ++n)
    {
	const CbmdosFile *file = CbmdosVfs_rfile(self->vfs, n);
	uint16_t fileBlocks = CbmdosFile_realBlocks(file);
        if (CbmdosFile_type(file) == CFT_REL)
        {
            uint8_t sidesects = fileBlocks / 120 + !!(fileBlocks % 120);
            fileBlocks += sidesects;
        }
	if (fileBlocks > free) return 0xffff;
	free -= fileBlocks;
    }
    return free;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x24(%rdi), %eax
testb $0x4, %al
movl $0x298, %ecx            # imm = 0x298
movl $0x2ed, %edx            # imm = 0x2ED
cmovel %ecx, %edx
testb $0x8, %al
movl $0x30f, %r12d           # imm = 0x30F
cmovel %edx, %r12d
movq 0x8(%rdi), %rdi
callq 0x5250
movl %eax, %r14d
movl 0x24(%rbx), %eax
cmpl $0x91, %r14d
jb 0xa814
movw $0xffff, %bp            # imm = 0xFFFF
testb $0x1, %al
je 0xa88d
leal -0x90(%r14), %eax
shrl $0x3, %eax
movl %r14d, %ecx
andl $0x7, %ecx
cmpl $0x1, %ecx
sbbl $-0x1, %eax
movzwl %r12w, %r12d
cmpl %r12d, %eax
ja 0xa88d
subl %eax, %r12d
jmp 0xa82a
testb $0x2, %al
je 0xa82a
movl $0x90, %eax
subl %r14d, %eax
shrl $0x3, %eax
movzwl %r12w, %r12d
addl %eax, %r12d
xorl %r15d, %r15d
movl %r12d, %ebp
cmpl %r15d, %r14d
je 0xa88d
movq 0x8(%rbx), %rdi
movl %r15d, %esi
callq 0x5350
movq %rax, %r13
movq %rax, %rdi
callq 0x56c0
movl %eax, %r12d
movq %r13, %rdi
callq 0x57c0
cmpl $0x4, %eax
jne 0xa87b
movl %r12d, %eax
xorl %edx, %edx
movw $0x78, %cx
divw %cx
xorl %ecx, %ecx
testw %dx, %dx
setne %cl
addl %eax, %ecx
movzbl %cl, %eax
addl %r12d, %eax
movl %eax, %r12d
cmpw %r12w, %bp
jb 0xa889
subl %r12d, %ebp
incl %r15d
jmp 0xa830
movw $0xffff, %bp            # imm = 0xFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: CbmdosFs_getFreeBlocksLine
SOEXPORT void CbmdosFs_getFreeBlocksLine(const CbmdosFs *self, uint8_t *line)
{
    uint16_t rawFree = CbmdosFs_freeBlocks(self);
    int free = (rawFree == 0xffff) ? -1 : rawFree;
    if (free > 0 && (self->options.flags & CFF_ZEROFREE)) free = 0;
    char freestr[4];
    snprintf(freestr, sizeof freestr, "%d", free);
    memset(line, 0xa0, 16);
    const char *blocksfree = " BLOCKS FREE.";
    uint8_t *w = line;
    const char *r = freestr;
    while (*r) *w++ = *r++;
    r = blocksfree;
    while (*r) *w++ = *r++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x53e0
movzwl %ax, %eax
cmpw $-0x1, %ax
pushq $-0x1
popq %rcx
cmovnel %eax, %ecx
testl %ecx, %ecx
jle 0xa8c8
xorl %eax, %eax
testb $-0x80, 0x24(%r14)
cmovnel %eax, %ecx
leaq 0x39f1(%rip), %rdx      # 0xe2c0
xorl %r14d, %r14d
leaq 0x4(%rsp), %rdi
pushq $0x4
popq %rsi
xorl %eax, %eax
callq 0x52a0
movaps 0x3208(%rip), %xmm0     # 0xdaf0
movups %xmm0, (%rbx)
movb 0x4(%rsp,%r14), %al
testb %al, %al
je 0xa8fd
movb %al, (%rbx,%r14)
incq %r14
jmp 0xa8eb
xorl %eax, %eax
leaq 0x39bd(%rip), %rcx      # 0xe2c3
cmpq $0xd, %rax
je 0xa91d
leaq (%rbx,%rax), %rdx
movb (%rax,%rcx), %sil
incq %rax
movb %sil, (%rdx,%r14)
jmp 0xa906
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: deleteChain
static void deleteChain(CbmdosFs *self, uint8_t nexttrack, uint8_t nextsect)
{
    if (self->bam[nexttrack-1][nextsect] != 1) return;
    do
    {
        if (nexttrack == 18 && nextsect == 0)
        {
            logmsg(L_WARNING, "CbmdosFs: refusing to delete BAM at [18:0]");
            return;
        }
        uint8_t *dir = Sector_content(
                D64_sector(self->d64, nexttrack, nextsect));
        self->bam[nexttrack-1][nextsect] = 0;
        nexttrack = dir[0];
        nextsect = dir[1];
    } while (nexttrack && self->bam[nexttrack-1][nextsect] == 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
leal (%r12,%rsi), %eax
movl %edx, %ecx
imulq $0x15, %rax, %rax
addq %rdi, %rax
addq $0x2c, %rax
cmpb $0x1, (%rcx,%rax)
jne 0xa9a3
movq %rdi, %rbx
leaq 0x2c(%rdi), %r13
movl %esi, %eax
xorb $0x12, %al
orb %dl, %al
je 0xa9ad
movzbl %sil, %r14d
movq (%rbx), %rdi
movzbl %dl, %r15d
movl %r14d, %esi
movl %r15d, %edx
callq 0x5030
movq %rax, %rdi
callq 0x56d0
imulq $0x15, %r14, %rcx
addq %r13, %rcx
movb $0x0, -0x15(%r15,%rcx)
movzbl (%rax), %esi
testq %rsi, %rsi
je 0xa9a3
movzbl 0x1(%rax), %edx
movl %esi, %eax
addl %r12d, %eax
imulq $0x15, %rax, %rax
addq %r13, %rax
cmpb $0x1, (%rdx,%rax)
je 0xa952
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x3a31(%rip), %rsi      # 0xe3e5
pushq $0x2
popq %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x5960
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: freeSectorOnTrack
static uint8_t freeSectorOnTrack(CbmdosFs *self, uint8_t trackno,
        uint8_t sectno, uint8_t interlv, int simpleInterlv)
{
    uint8_t sectors = Track_sectors(D64_track(self->d64, trackno));
    uint8_t nextsect = 0;
    if (interlv)
    {
	if (simpleInterlv)
	{
	    nextsect = (sectno + interlv) % sectors;
	}
	else
	{
	    nextsect = sectno + interlv;
	    if (nextsect >= sectors)
	    {
		nextsect -= sectors;
		if (nextsect) --nextsect;
	    }
	}
    }
    uint8_t tmp = nextsect;
    while (self->bam[trackno-1][nextsect])
    {
        ++nextsect;
        if (nextsect == sectors) nextsect = 0;
        if (nextsect == tmp) break;
    }
    return self->bam[trackno-1][nextsect] ? 0xff : nextsect;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %r12d
movl %ecx, %ebx
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x5290
movq %rax, %rdi
callq 0x5780
movl %eax, %ecx
xorl %esi, %esi
testl %ebx, %ebx
je 0xaa15
testl %r12d, %r12d
je 0xaa0c
movzbl %r15b, %edx
movzbl %bl, %eax
addl %edx, %eax
movzbl %cl, %edi
xorl %edx, %edx
divw %di
movl %edx, %ebx
jmp 0xaa17
addb %r15b, %bl
cmpb %cl, %bl
jb 0xaa17
jne 0xaa57
xorl %ebx, %ebx
addq $0x2c, %r14
movzbl %bpl, %eax
decq %rax
imulq $0x15, %rax, %rdx
addq %r14, %rdx
movl %ebx, %eax
movzbl %al, %edi
cmpb $0x0, (%rdi,%rdx)
je 0xaa4e
incb %al
cmpb %cl, %al
movzbl %al, %eax
cmovel %esi, %eax
cmpb %bl, %al
jne 0xaa2b
movzbl %bl, %ecx
xorl %eax, %eax
cmpb (%rcx,%rdx), %al
sbbl %eax, %eax
orb %bl, %al
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %ecx, %eax
notb %al
addb %al, %bl
jmp 0xaa17
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: createTrackBam
static void createTrackBam(CbmdosFs *self, uint8_t *tbam, uint8_t trackno)
{
    uint8_t sectors = Track_sectors(D64_track(self->d64, trackno));
    tbam[0] = sectors;
    tbam[1] = 0xff;
    tbam[2] = 0xff;
    tbam[3] = 0xff >> (24 - sectors);
    for (uint8_t sectno = 0; sectno < sectors; ++sectno)
    {
        if (self->bam[trackno-1][sectno])
        {
            --tbam[0];
            tbam[1+sectno/8] ^= (1U << (sectno%8));
        }
    }
    if (self->options.flags & CFF_ZEROFREE)
    {
	tbam[0] = 0;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movl %edx, %esi
callq 0x5290
movq %rax, %rdi
callq 0x5780
movb %al, (%rbx)
orw $-0x1, 0x1(%rbx)
movb $0x18, %cl
subb %al, %cl
movl $0xff, %edx
shrl %cl, %edx
movb %dl, 0x3(%rbx)
movl %ebp, %ecx
movzbl %al, %edx
imulq $0x15, %rcx, %rcx
leaq (%rcx,%r14), %rsi
addq $0x17, %rsi
xorl %edi, %edi
cmpq %rdi, %rdx
je 0xabe0
cmpb $0x0, (%rsi,%rdi)
je 0xabdb
movl %edi, %ecx
andb $0x7, %cl
movb $0x1, %r8b
shlb %cl, %r8b
decb %al
movb %al, (%rbx)
movl %edi, %ecx
shrl $0x3, %ecx
andl $0x1f, %ecx
xorb %r8b, 0x1(%rbx,%rcx)
incq %rdi
jmp 0xabb4
testb $-0x80, 0x24(%r14)
je 0xabea
movb $0x0, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: scratchFile
static void scratchFile(CbmdosFs *self, unsigned pos)
{
    if (self->dir.entries[pos].sidetrack)
    {
        deleteChain(self, self->dir.entries[pos].sidetrack,
                self->dir.entries[pos].sidesector);
    }
    if (self->dir.entries[pos].starttrack)
    {
        deleteChain(self, self->dir.entries[pos].starttrack,
                self->dir.entries[pos].startsector);
    }
    memset(self->dir.entries + pos, 0, sizeof *self->dir.entries);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movl %esi, %ecx
imulq $0x6, %rcx, %r14
movb 0x4(%rax,%r14), %cl
testb %cl, %cl
je 0xac1f
addq %r14, %rax
movzbl 0x5(%rax), %edx
movzbl %cl, %esi
movq %rbx, %rdi
callq 0xa925
movq 0x10(%rbx), %rax
movb 0x2(%rax,%r14), %cl
testb %cl, %cl
je 0xac3e
addq %r14, %rax
movzbl 0x3(%rax), %edx
movzbl %cl, %esi
movq %rbx, %rdi
callq 0xa925
movq 0x10(%rbx), %rax
andw $0x0, 0x4(%rax,%r14)
andl $0x0, (%rax,%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: findStartSector
static int findStartSector(CbmdosFs *self,
        uint8_t *trackno, uint8_t *sectno, const CbmdosFsOptions *opts)
{
    uint8_t tn = startTrack(opts, 0);
    do
    {
	for (uint8_t sn = 0;
		sn < Track_sectors(D64_rtrack(self->d64, tn)); ++sn)
	{
	    if (!self->bam[tn-1][sn])
	    {
		*trackno = tn;
		*sectno = sn;
		return 0;
	    }
	}
    } while ((tn = startTrack(opts, tn)));
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, (%rsp)
movq %rdi, %r12
movq %rcx, 0x10(%rsp)
movq %rcx, %rdi
xorl %esi, %esi
callq 0xad90
movl %eax, %r13d
leaq 0x17(%r12), %r15
movzbl %r13b, %ebx
imulq $0x15, %rbx, %r14
addq %r15, %r14
xorl %ebp, %ebp
movq (%r12), %rdi
movl %ebx, %esi
callq 0x5060
movq %rax, %rdi
callq 0x5780
movzbl %al, %eax
cmpq %rax, %rbp
jae 0xacb7
cmpb $0x0, (%r14,%rbp)
je 0xaccf
incq %rbp
jmp 0xac90
movq 0x10(%rsp), %rdi
movl %ebx, %esi
callq 0xad90
movl %eax, %r13d
testb %al, %al
jne 0xac83
pushq $-0x1
popq %rax
jmp 0xace0
movq (%rsp), %rax
movb %r13b, (%rax)
movq 0x8(%rsp), %rax
movb %bpl, (%rax)
xorl %eax, %eax
addq $0x18, %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/cbmdosfs.c
// Function: findNextSector
static int findNextSector(CbmdosFs *self,
        uint8_t *trackno, uint8_t *sectno, const CbmdosFsOptions *opts)
{
    uint8_t tn = *trackno;
    uint8_t sn = freeSectorOnTrack(self, tn, *sectno, opts->fileInterleave,
            (opts->flags & CFF_SIMPLEINTERLEAVE));
    do
    {
	if (sn != 0xff)
	{
	    *trackno = tn;
	    *sectno = sn;
	    return 0;
	}
	if ((tn = nextTrack(opts, tn)))
	{
	    if (opts->flags & CFF_TALLOC_CHAININTERLV)
	    {
		sn = freeSectorOnTrack(self, tn, sn, opts->fileInterleave,
                        (opts->flags & CFF_SIMPLEINTERLEAVE));
	    }
	    else
	    {
		sn = freeSectorOnTrack(self, tn, sn, 0, 0);
	    }
	}
    } while (tn);
    return findStartSector(self, trackno, sectno, opts);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movb (%rsi), %bpl
movzbl (%rdx), %edx
movzbl 0x5(%rcx), %ecx
movl $0x200, %r8d            # imm = 0x200
andl (%r14), %r8d
movzbl %bpl, %esi
callq 0xa9c5
cmpb $-0x1, %al
jne 0xad67
movzbl %bpl, %esi
movq %r14, %rdi
callq 0xaa5f
testb %al, %al
je 0xad77
movl %eax, %ebp
movl (%r14), %r8d
btl $0xd, %r8d
movzbl %al, %esi
jb 0xad51
movq %r12, %rdi
movl $0xff, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
jmp 0xad1a
movzbl 0x5(%r14), %ecx
andl $0x200, %r8d            # imm = 0x200
movq %r12, %rdi
movl $0xff, %edx
jmp 0xad1a
movb %bpl, (%r15)
movb %al, (%rbx)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %r14, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xac52
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfs.c
// Function: startTrack
static uint8_t startTrack(const CbmdosFsOptions *opts, uint8_t trackno)
{
    if (!trackno)
    {
	if ((opts->flags & CFF_FILESONDIRTRACK)
		&& (opts->flags & CFF_TALLOC_PREFDIRTRACK))
	{
	    return 18;
	}
	if (opts->flags & CFF_TALLOC_TRACKLOAD)
	{
	    return 1;
	}
	if (opts->flags & CFF_TALLOC_SIMPLE)
	{
	    return 19;
	}
	return 17;
    }
    if (opts->flags & (CFF_TALLOC_TRACKLOAD | CFF_TALLOC_SIMPLE))
    {
	return nextTrack(opts, trackno);
    }
    if (trackno >= 40 && !(opts->flags & CFF_42TRACK))
    {
	return 0;
    }
    if (trackno >= 35)
    {
	if (!(opts->flags & (CFF_40TRACK | CFF_42TRACK)))
	{
	    return 0;
	}
	return trackno + 1;
    }
    int diff = 18 - trackno;
    if (!diff) return 17;
    if (diff > 0) return 18 + diff;
    return 18 + diff - 1;
}

// Assembly:
movl (%rdi), %ecx
testl %esi, %esi
je 0xada6
testw $0xc00, %cx             # imm = 0xC00
je 0xadc9
movzbl %sil, %esi
jmp 0xaa5f
movl %ecx, %edx
notl %edx
movb $0x12, %al
testw $0x1002, %dx            # imm = 0x1002
je 0xadc8
movb $0x1, %al
btl $0xa, %ecx
jb 0xadc8
shrl $0xb, %ecx
andl $0x1, %ecx
addb %cl, %cl
orb $0x11, %cl
movl %ecx, %eax
retq
cmpb $0x28, %sil
setae %al
testb $0x8, %cl
sete %dl
testb %dl, %al
je 0xaddd
xorl %eax, %eax
retq
cmpb $0x23, %sil
jb 0xadf3
andl $0xc, %ecx
incb %sil
testl %ecx, %ecx
movzbl %sil, %eax
cmovel %ecx, %eax
retq
movb $0x11, %al
cmpb $0x12, %sil
je 0xadc8
jae 0xae01
movb $0x24, %al
jmp 0xae03
movb $0x23, %al
subb %sil, %al
retq
nop
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosfsoptions.c
// Function: CbmdosFsOptions_applyOverrides
void CbmdosFsOptions_applyOverrides(CbmdosFsOptions *self,
        const CbmdosFsOptOverrides *overrides)
{
    uint8_t interleave = CbmdosFsOptOverrides_interleave(overrides);
    if (interleave != 0xff) self->fileInterleave = interleave;

    CbmdosFsFlags mask = overrides->mask;
    mask &= ~CFF_OVERRIDE_INTERLEAVE;
    self->flags &= ~mask;
    self->flags |= (overrides->flags & mask);
}

// Assembly:
movl (%rsi), %ecx
movl 0x4(%rsi), %eax
testw $0x1ff, %ax             # imm = 0x1FF
je 0xae1b
cmpb $-0x1, %cl
je 0xae1b
movb %cl, 0x5(%rdi)
movl (%rdi), %edx
xorl %edx, %ecx
andl %ecx, %eax
andl $0xfffffe00, %eax       # imm = 0xFFFFFE00
xorl %edx, %eax
movl %eax, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosinode.c
// Function: CbmdosInode_create
SOLOCAL CbmdosInode *CbmdosInode_create(void)
{
    CbmdosInode *self = xmalloc(sizeof *self);
    self->data = FileData_create();
    self->changedEvent = Event_create(0, self);
    self->overrides = CFOO_NONE;
    self->refcount = 0;
    Event_register(FileData_changedEvent(self->data), self, fileDataHandler);
    return self;
}

// Assembly:
pushq %rbx
pushq $0x20
popq %rdi
callq 0x589c
movq %rax, %rbx
callq 0x5520
movq %rax, (%rbx)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x5280
movq %rax, 0x8(%rbx)
andq $0x0, 0x10(%rbx)
andl $0x0, 0x18(%rbx)
movq (%rbx), %rdi
callq 0x5440
leaq 0x10(%rip), %rdx        # 0xaeae
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5580
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosinode.c
// Function: CbmdosInode_clone
SOLOCAL CbmdosInode *CbmdosInode_clone(const CbmdosInode *other)
{
    CbmdosInode *self = xmalloc(sizeof *self);
    self->data = FileData_clone(other->data);
    self->changedEvent = Event_create(0, self);
    self->overrides = other->overrides;
    self->refcount = 0;
    Event_register(FileData_changedEvent(self->data), self, fileDataHandler);
    return self;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x20
popq %rdi
callq 0x589c
movq %rax, %rbx
movq (%r14), %rdi
callq 0x5150
movq %rax, (%rbx)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x5280
movq %rax, 0x8(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
andl $0x0, 0x18(%rbx)
movq (%rbx), %rdi
callq 0x5440
leaq -0x5a(%rip), %rdx       # 0xaeae
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5580
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/cbmdosinode.c
// Function: CbmdosInode_setData
SOEXPORT void CbmdosInode_setData(CbmdosInode *self, FileData *data)
{
    Event_unregister(FileData_changedEvent(self->data), self, fileDataHandler);
    FileData_destroy(self->data);
    self->data = data;
    Event_register(FileData_changedEvent(self->data), self, fileDataHandler);
    CbmdosInodeEventArgs ea = { CIE_DATACHANGED };
    Event_raise(self->changedEvent, &ea);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x5440
leaq -0x96(%rip), %r15       # 0xaeae
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x5340
movq (%rbx), %rdi
callq 0x53f0
movq %r14, (%rbx)
movq %r14, %rdi
callq 0x5440
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x5580
leaq 0xc(%rsp), %rsi
andl $0x0, (%rsi)
movq 0x8(%rbx), %rdi
callq 0x5610
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosinode.c
// Function: CbmdosInode_setOptOverrides
SOEXPORT void CbmdosInode_setOptOverrides(
        CbmdosInode *self, CbmdosFsOptOverrides overrides)
{
    if (overrides.mask != self->overrides.mask
	    || overrides.flags != self->overrides.flags)
    {
	self->overrides = overrides;
	CbmdosInodeEventArgs args = { CIE_OPTOVERRIDESCHANGED };
	Event_raise(self->changedEvent, &args);
    }
}

// Assembly:
movq %rsi, %rax
shrq $0x20, %rax
cmpl %eax, 0x14(%rdi)
jne 0xafcc
cmpl %esi, 0x10(%rdi)
je 0xafeb
pushq %rax
movl %esi, 0x10(%rdi)
movl %eax, 0x14(%rdi)
leaq 0x4(%rsp), %rsi
movl $0x1, (%rsi)
movq 0x8(%rdi), %rdi
callq 0x5610
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/cbmdosinode.c
// Function: CbmdosInode_tryDestroy
SOLOCAL void CbmdosInode_tryDestroy(CbmdosInode *self)
{
    if (!self) return;
    if (self->refcount) return;
    Event_destroy(self->changedEvent);
    FileData_destroy(self->data);
    free(self);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0xb020
movq %rdi, %rbx
cmpl $0x0, 0x18(%rdi)
je 0xb022
popq %rbx
retq
movq 0x8(%rbx), %rdi
callq 0x5170
movq (%rbx), %rdi
callq 0x53f0
movq %rbx, %rdi
popq %rbx
jmp 0x5080
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/lynx.c
// Function: findHeader
static int findHeader(size_t *sigpos, uint8_t *dirblocks, size_t *dirpos,
	const uint8_t *content, size_t size)
{
    size_t pos = 0;
    if (size < 255) return -1;
    size_t base = content[0] | (content[1] << 8);
    size_t next = content[2] | (content[3] << 8);
    if (next <= base) goto lynxhdr;
    pos = next - base + 2;
    if (pos > size - 5)
    {
	pos = 0;
	goto lynxhdr;
    }
    if (content[pos-1])
    {
	pos = 0;
	goto lynxhdr;
    }
    while (content[pos] || content[pos+1])
    {
	size_t nextline = content[pos] | (content[pos+1] << 8);
	if (nextline <= next) return -1;
	next = nextline;
	pos = next - base + 2;
	if (pos > size - 5) return -1;
	if (content[pos-1]) return -1;
    }
    pos += 2;
    if (content[pos++] != 0x0d) return -1;
lynxhdr:
    if (findLynxHeader(&pos, dirblocks, dirpos, content, size) < 0) return -1;
    *sigpos = pos;
    return 0;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0xff, %r8
jb 0xb146
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movzwl (%rcx), %r10d
movzwl 0x2(%rcx), %ebx
movq %rbx, %r14
subq %r10, %r14
jbe 0xb0ba
leaq 0x2(%r14), %r9
leaq -0x5(%r8), %r11
cmpq %r11, %r9
ja 0xb0ba
cmpb $0x0, 0x1(%rcx,%r14)
je 0xb101
xorl %r9d, %r9d
cmpq %r8, %r9
movq %r8, %r10
cmovaq %r9, %r10
cmpq %r8, %r9
jae 0xb124
cmpb $0x20, (%rcx,%r9)
jne 0xb121
incq %r9
jmp 0xb0c7
movzbl %bpl, %r14d
shll $0x8, %r14d
orq %r15, %r14
cmpq %rbx, %r14
jbe 0xb140
movq %r14, %rbx
subq %r10, %rbx
leaq 0x2(%rbx), %r9
cmpq %r11, %r9
ja 0xb140
cmpb $0x0, 0x1(%rcx,%rbx)
movq %r14, %rbx
jne 0xb140
movzbl (%rcx,%r9), %r15d
movb 0x1(%rcx,%r9), %bpl
movl %r15d, %r14d
orb %bpl, %r14b
jne 0xb0d8
cmpb $0xd, 0x2(%rcx,%r9)
jne 0xb140
addq $0x3, %r9
jmp 0xb0bd
movq %r9, %r10
cmpq %r8, %r10
je 0xb140
movb (%rcx,%r10), %r9b
leal -0x3a(%r9), %r11d
cmpb $-0x9, %r11b
jb 0xb140
leaq 0x1(%r10), %rbx
cmpq %r8, %rbx
jne 0xb147
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
addb $-0x30, %r9b
movb (%rcx,%rbx), %r11b
leal -0x30(%r11), %ebp
cmpb $0x9, %bpl
ja 0xb17f
addq $0x2, %r10
cmpq %r8, %r10
je 0xb140
movb (%rcx,%r10), %bl
addb $-0x30, %bl
cmpb $0xa, %bl
jb 0xb140
movzbl %r9b, %r9d
imull $0xa, %r9d, %r9d
addb %r11b, %r9b
addb $-0x30, %r9b
jmp 0xb182
movq %rbx, %r10
cmpq %r8, %r10
movq %r8, %r11
cmovaq %r10, %r11
cmpq %r8, %r10
jae 0xb1a0
cmpb $0x20, (%rcx,%r10)
jne 0xb19d
incq %r10
jmp 0xb18c
movq %r10, %r11
cmpq %r8, %r11
movq %r8, %rbx
cmovaq %r11, %rbx
movq %r11, %r10
cmpq %r8, %r10
jae 0xb1c5
movzbl (%rcx,%r10), %ebp
testl %ebp, %ebp
je 0xb140
cmpl $0xd, %ebp
je 0xb1c8
incq %r10
jmp 0xb1ad
movq %rbx, %r10
incq %r10
addq $-0x5, %r8
cmpq %r8, %r10
ja 0xb140
movb %r9b, (%rsi)
movq %r10, (%rdx)
movq %r11, (%rdi)
xorl %eax, %eax
jmp 0xb140
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/lynx.c
// Function: parsePetsciiNum
static int parsePetsciiNum(uint16_t *num, size_t *pos,
	const uint8_t *content, size_t size)
{
    size_t p = *pos;
    while (p < size && content[p] == 0x20) ++p;
    if (content[p] < 0x31 || content[p] > 0x39) return -1;
    uint16_t n = content[p++] - 0x30;
    if (p == size) return -1;
    if (content[p] > 0x2f && content[p] < 0x3a)
    {
	n *= 10;
	n += (content[p++] - 0x30);
	if (p == size) return -1;
    }
    if (content[p] > 0x2f && content[p] < 0x3a)
    {
	n *= 10;
	n += (content[p++] - 0x30);
	if (p == size) return -1;
    }
    if (content[p] > 0x2f && content[p] < 0x3a) return -1;
    while (p < size && content[p] == 0x20) ++p;
    if (p == size) return -1;
    if (content[p] != 0x0d) return -1;
    if (++p == size) return -1;
    *pos = p;
    *num = n;
    return 0;
}

// Assembly:
movq (%rsi), %rax
cmpq %rcx, %rax
movq %rcx, %r8
cmovaq %rax, %r8
cmpq %rcx, %rax
jae 0xb72a
movb (%rdx,%rax), %r9b
cmpb $0x20, %r9b
jne 0xb730
incq %rax
jmp 0xb716
movb (%rdx,%r8), %r9b
jmp 0xb733
movq %rax, %r8
leal -0x3a(%r9), %r10d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpb $-0x9, %r10b
jb 0xb800
leaq 0x1(%r8), %r10
cmpq %rcx, %r10
je 0xb800
pushq %rbx
movzbl %r9b, %r9d
addl $-0x30, %r9d
movzbl (%rdx,%r10), %ebx
leal -0x30(%rbx), %r11d
cmpb $0x9, %r11b
ja 0xb7c1
leaq 0x2(%r8), %r11
cmpq %rcx, %r11
je 0xb7ff
movswl %r9w, %r9d
imull $0xa, %r9d, %r9d
movzwl %bx, %r10d
addl %r10d, %r9d
addl $-0x30, %r9d
movzbl (%rdx,%r11), %r10d
leal -0x30(%r10), %ebx
cmpb $0x9, %bl
ja 0xb801
addq $0x3, %r8
cmpq %rcx, %r8
je 0xb7ff
movb (%rdx,%r8), %r11b
addb $-0x30, %r11b
cmpb $0xa, %r11b
jb 0xb7ff
imull $0xa, %r9d, %r9d
movzwl %r10w, %r10d
addl %r10d, %r9d
addl $-0x30, %r9d
jmp 0xb7c4
movq %r10, %r8
cmpq %rcx, %r8
movq %rcx, %r10
cmovaq %r8, %r10
cmpq %rcx, %r8
jae 0xb7e2
cmpb $0x20, (%rdx,%r8)
jne 0xb7df
incq %r8
jmp 0xb7ce
movq %r8, %r10
cmpq %rcx, %r10
je 0xb7ff
cmpb $0xd, (%rdx,%r10)
jne 0xb7ff
incq %r10
cmpq %rcx, %r10
je 0xb7ff
movq %r10, (%rsi)
movw %r9w, (%rdi)
xorl %eax, %eax
popq %rbx
retq
movq %r11, %r8
jmp 0xb7c4
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/lynx.c
// Function: archiveLynx
SOEXPORT FileData *archiveLynx(const CbmdosVfs *vfs)
{
    unsigned filecount = CbmdosVfs_fileCount(vfs);
    if (!filecount) return 0;
    const CbmdosFile **files = xmalloc(filecount * sizeof *files);
    unsigned realFilecount = 0;
    for (unsigned i = 0; i < filecount; ++i)
    {
	const CbmdosFile *file = CbmdosVfs_rfile(vfs, i);
	if (CbmdosFile_type(file) != CFT_DEL)
	{
	    files[realFilecount++] = file;
	}
    }
    if (!realFilecount)
    {
	free(files);
	return 0;
    }
    FileData *archive = archiveLynxFiles(files, realFilecount);
    free(files);
    return archive;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
callq 0x5250
xorl %ebx, %ebx
testl %eax, %eax
je 0xbe00
movl %eax, %ebp
movl %eax, %edi
shlq $0x3, %rdi
callq 0x589c
movq %rax, %r14
xorl %r12d, %r12d
cmpl %r12d, %ebp
je 0xbde3
movq %r15, %rdi
movl %r12d, %esi
callq 0x5350
movq %rax, %r13
movq %rax, %rdi
callq 0x57c0
testl %eax, %eax
je 0xbdde
movl %ebx, %eax
incl %ebx
movq %r13, (%r14,%rax,8)
incl %r12d
jmp 0xbdb7
testl %ebx, %ebx
je 0xbdf6
movq %r14, %rdi
movl %ebx, %esi
callq 0x5480
movq %rax, %rbx
jmp 0xbdf8
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x5080
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/excess-c64[P]lib1541img/src/lib/1541img/petscii.c
// Function: appendUtf8
static size_t appendUtf8(
	char *buf, size_t bufsz, size_t *bufpos, const char *chrStr)
{
    size_t chrLen = strlen(chrStr);
    if (bufsz > *bufpos + chrLen + 1)
    {
        strcpy(buf + *bufpos, chrStr);
    }
    *bufpos += chrLen;
    return chrLen;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r12
movq %rcx, %rdi
callq 0x5260
movq %rax, %r14
movq (%rbx), %rax
leaq (%r14,%rax), %rcx
incq %rcx
cmpq %r13, %rcx
jae 0xc024
addq %rax, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x5100
movq (%rbx), %rax
addq %r14, %rax
movq %rax, (%rbx)
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Encryptr[P]O-plus-plus/opp/opp.c
// Function: opp_init_file
void opp_init_file(const char* fname, struct Opp_Scan* s)
{
	long size = 0;
	s->io.file = fopen(fname, "r");
	s->io.fname = fname;

	if (!s->io.file)
		printf("\"%s\" Is not a file...\n", fname), exit(1);

	fseek(s->io.file, 0, SEEK_END);
	size = ftell(s->io.file);
	s->io.fsize = size;
	rewind(s->io.file);
	char* content = calloc(1, size + 2);

	if (content == NULL)
		INTERNAL_ERROR("Malloc fail");

	int _ = fread(content, size, 1, s->io.file);
	fclose(s->io.file);

	init_opp_lex(s, content);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xa50a(%rip), %rsi      # 0xb848
callq 0x11e0
movq %rax, 0x18(%rbx)
movq %r14, 0x10(%rbx)
testq %rax, %rax
je 0x13cb
pushq $0x2
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x1190
movq 0x18(%rbx), %rdi
callq 0x1150
movq %rax, %r14
movq %rax, 0x20(%rbx)
movq 0x18(%rbx), %rdi
callq 0x10f0
movq %r14, %rsi
addq $0x2, %rsi
pushq $0x1
popq %rdi
callq 0x1130
movq %rax, %r15
testq %rax, %rax
jne 0x13a0
leaq 0x8c93(%rip), %rdi      # 0xa027
leaq 0x8c98(%rip), %rsi      # 0xa033
callq 0x9287
movq 0x18(%rbx), %rcx
pushq $0x1
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1070
movq 0x18(%rbx), %rdi
callq 0x10a0
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x939a
leaq 0x8c3e(%rip), %rdi      # 0xa010
movq %r14, %rsi
xorl %eax, %eax
callq 0x10e0
pushq $0x1
popq %rdi
callq 0x1210
// File: /workspace/github_c_makefile_star2_O2/Encryptr[P]O-plus-plus/opp/opp.c
// Function: run_main
void run_main(struct OppIr* ir)
{
	void *mem = mmap(NULL, 4096, PROT_WRITE | PROT_EXEC,
        32 | MAP_PRIVATE, -1, 0);

	memcpy(mem, ir->code.bytes, ir->code.idx);

	long (*run)(int) = mem;
	printf("%ld\n", run(2));
	munmap(mem, 4096);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x6
popq %rdx
pushq $0x22
popq %rcx
pushq $-0x1
popq %r8
movl $0x1000, %esi           # imm = 0x1000
xorl %edi, %edi
xorl %r9d, %r9d
callq 0x10c0
movq %rax, %r14
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %rax, %rdi
callq 0x1170
pushq $0x2
popq %rdi
callq *%r14
leaq 0xa16f(%rip), %rdi      # 0xb592
movq %rax, %rsi
xorl %eax, %eax
callq 0x10e0
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11b0
// File: /workspace/github_c_makefile_star2_O2/Encryptr[P]O-plus-plus/opp/opp.c
// Function: opp_add_module
void opp_add_module(struct Opp_Parser* old, char* fname)
{
	struct Opp_Scan* new_scan = (struct Opp_Scan*)malloc(sizeof(struct Opp_Scan));

	if (new_scan == NULL)
		INTERNAL_ERROR("Malloc fail");

	char* path = fname;
	if (access(path, F_OK) == -1) {
		if (stdheader_path == NULL)
			INTERNAL_ERROR("Unknown path to stdlib");
		path = (char*)malloc(strlen(fname) + strlen(stdheader_path) + 1);
		sprintf(path, "%s%s", stdheader_path, fname);
	}

	opp_init_file(path, new_scan);

	struct Opp_Scan* temp = old->lex;
	old->lex = new_scan;

	opp_parser_begin(old);

	old->lex = temp;
	
	opp_free_lex(new_scan, 1);
	free(path);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x50
popq %rdi
callq 0x1180
movq %rax, %r15
testq %rax, %rax
jne 0x1755
leaq 0x88de(%rip), %rdi      # 0xa027
leaq 0x8911(%rip), %rsi      # 0xa061
callq 0x9287
movq %rbx, %rdi
xorl %esi, %esi
callq 0x11d0
cmpl $-0x1, %eax
jne 0x17c6
movq 0xea65(%rip), %r12      # 0x101d0
testq %r12, %r12
jne 0x178a
leaq 0x88f9(%rip), %rdi      # 0xa070
leaq 0x88e3(%rip), %rsi      # 0xa061
callq 0x9287
movq 0xea46(%rip), %r12      # 0x101d0
movq %rbx, %rdi
callq 0x10b0
movq %rax, %r13
movq %r12, %rdi
callq 0x10b0
leaq (%rax,%r13), %rdi
incq %rdi
callq 0x1180
movq %rax, %r13
leaq 0x88d4(%rip), %rsi      # 0xa087
movq %rax, %rdi
movq %r12, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1200
movq %r13, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x132c
movq (%r14), %r12
movq %r15, (%r14)
movq %r14, %rdi
callq 0x7eee
movq %r12, (%r14)
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x93db
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O2/Encryptr[P]O-plus-plus/opp/analysis/analysis.c
// Function: opp_init_analize
struct Opp_Analize* opp_init_analize(struct Opp_Parser* parser, struct Opp_Options* opts)
{
	struct Opp_Analize* ctx = (struct Opp_Analize*)malloc(sizeof(struct Opp_Analize));

	if (ctx == NULL)
		goto err;

	ctx->opts = opts;

	ctx->parser = parser;
	ctx->debug.scope = NULL;
	ctx->debug.ret = 0;

	// Namespace
	ctx->ns = init_namespace(NULL, (void*)alloc);
	ctx->curr_ns = ctx->ns;
	ctx->parser->scope = ctx->ns;

	return ctx;

err:
	INTERNAL_ERROR("Malloc Fail");
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
pushq $0x48
popq %rdi
callq 0x1180
movq %rax, %rbx
testq %rax, %rax
je 0x1c13
movq %r15, (%rbx)
movq %r14, 0x8(%rbx)
andq $0x0, 0x20(%rbx)
movb $0x0, 0x28(%rbx)
leaq 0x5e78(%rip), %rsi      # 0x7a76
xorl %edi, %edi
callq 0x9c2a
movq %rax, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movq %rax, 0x30(%r14)
jmp 0x1c26
leaq 0x8976(%rip), %rdi      # 0xa590
leaq 0x897b(%rip), %rsi      # 0xa59c
callq 0x9287
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/Encryptr[P]O-plus-plus/opp/analysis/analysis.c
// Function: opp_semantics_error
static void opp_semantics_error(struct Opp_Analize* ctx, 
		struct Opp_Node* node, const char* str, ...)
{
	va_list ap;
	va_start(ap, str);
	
	printf("%s:%u:%u ", ctx->parser->lex->io.fname, 
			node->debug.line, node->debug.colum);
	#ifdef UNX
		printf(CL_RED);
	#endif

	if (ctx->debug.scope != NULL)
		printf("semantics error: in function \"%s(...)\"\n\t", ctx->debug.scope);
	else
		printf("semantics error: in declaration\n\t");

	#ifdef UNX
		printf(CL_RESET);
	#endif
	vfprintf(stdout, str, ap);
	fprintf(stdout, "\n");
	va_end(ap);
	exit(1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rdx
movq %rcx, 0x18(%rdx)
movq %r8, 0x20(%rdx)
movq %r9, 0x28(%rdx)
testb %al, %al
je 0x2284
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, 0x10(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rsp)
movq 0x8(%rdi), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movl 0x4(%rsi), %edx
movl 0x8(%rsi), %ecx
leaq 0x8390(%rip), %rdi      # 0xa64c
movq %rax, %rsi
xorl %eax, %eax
callq 0x10e0
leaq 0x7f01(%rip), %rdi      # 0xa1ce
xorl %eax, %eax
callq 0x10e0
movq 0x20(%r14), %rsi
testq %rsi, %rsi
jne 0x22ed
leaq 0x839b(%rip), %rdi      # 0xa67f
xorl %eax, %eax
callq 0x10e0
jmp 0x22fb
leaq 0x8362(%rip), %rdi      # 0xa656
xorl %eax, %eax
callq 0x10e0
leaq 0x7f8b(%rip), %rdi      # 0xa28d
xorl %eax, %eax
callq 0x10e0
movq 0xdcd0(%rip), %r14      # 0xffe0
movq (%r14), %rdi
movq %rsp, %rdx
movq %rbx, %rsi
callq 0x11f0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x1120
pushq $0x1
popq %rdi
callq 0x1210