// File: /workspace/github_c_makefile_star2_O0/excess-c64[P]lib1541img/src/lib/1541img/lynx.c
// Function: extractLynx
SOEXPORT int extractLynx(CbmdosVfs *vfs, const FileData *file)
{
    size_t size = FileData_size(file);
    const uint8_t *content = FileData_rcontent(file);
    size_t sigpos;
    uint8_t dirblocks;
    size_t pos;
    if (findHeader(&sigpos, &dirblocks, &pos, content, size) < 0)
    {
	logmsg(L_ERROR, "extractLynx: not a valid LyNX file.");
	return -1;
    }
    char sig[80] = {0};
    size_t siglen = pos - sigpos - 1;
    if (siglen >= sizeof sig) siglen = sizeof sig - 1;
    memcpy(sig, content + sigpos, siglen);
    logfmt(L_INFO, "extractLynx: found signature `%s'.", sig);
    uint16_t numfiles;
    if (parsePetsciiNum(&numfiles, &pos, content, size) < 0)
    {
	logmsg(L_ERROR, "extractLynx: couldn't read number of files.");
	return -1;
    }
    LynxDirEntry *dir = xmalloc(numfiles * sizeof *dir);
    memset(dir, 0, numfiles * sizeof *dir);
    int rc = -1;

    for (int i = 0; i < numfiles; ++i)
    {
	uint8_t namelen = 0;
	while (pos + namelen < size
		&& content[pos + namelen] != 0x0d) ++namelen;
	if (pos + namelen + 1 >= size)
	{
	    logmsg(L_ERROR, "extractLynx: unexpected end of file.");
	    goto done;
	}
	size_t tmppos = pos + namelen + 1;
	while (content[pos + namelen - 1] == 0xa0) --namelen;
	dir[i].file = CbmdosFile_create();
	CbmdosFile_setName(dir[i].file, (const char *)(content + pos), namelen);
	pos = tmppos;
	if (parsePetsciiNum(&dir[i].blocks, &pos, content, size) < 0)
	{
	    logmsg(L_ERROR, "extractLynx: error parsing block size of file.");
	    goto done;
	}
	if (!content[pos])
	{
	    logmsg(L_ERROR, "extractLynx: invalid file type found.");
	    goto done;
	}
	int t;
	for (t = 1; t < (int) sizeof lynxfiletype; ++t)
	{
	    if (lynxfiletype[t] == content[pos]) break;
	}
	if (t == sizeof lynxfiletype)
	{
	    logmsg(L_ERROR, "extractLynx: invalid file type found.");
	    goto done;
	}
	CbmdosFileType type = (CbmdosFileType) t;
	if (++pos == size)
	{
	    logmsg(L_ERROR, "extractLynx: unexpected end of file.");
	    goto done;
	}
	if (content[pos] != 0x0d)
	{
	    logmsg(L_ERROR, "extractLynx: invalid file type found.");
	    goto done;
	}
	if (++pos == size)
	{
	    logmsg(L_ERROR, "extractLynx: unexpected end of file.");
	    goto done;
	}
	CbmdosFile_setType(dir[i].file, type);
	if (type == CFT_REL)
	{
	    uint16_t recordlen;
	    if (parsePetsciiNum(&recordlen, &pos, content, size) < 0)
	    {
		logmsg(L_ERROR,
			"extractLynx: error parsing record length of file.");
		goto done;
	    }
	    CbmdosFile_setRecordLength(dir[i].file, recordlen);
	}
	uint16_t lsu;
	if (parsePetsciiNum(&lsu, &pos, content, size) < 0)
	{
	    if (i == numfiles - 1)
	    {
		logmsg(L_INFO, "extractLynx: last block usage of last file "
			"missing, assuming size from the container.");
		dir[i].size = 0;
	    }
	    else
	    {
		logmsg(L_ERROR, "extractLynx: error parsing last block usage "
			"of file.");
		goto done;
	    }
	}
	else
	{
	    dir[i].size = 254 * (dir[i].blocks - 1) + (lsu - 1);
	}
    }

    for (int i = 0; i < numfiles; ++i)
    {
	size_t pad = 254 - (pos%254);
	pos += pad;
	if (pos >= size)
	{
	    logmsg(L_ERROR, "extractLynx: unexpected end of file.");
	    goto done;
	}
	if (i == 0 && pos != dirblocks * 254)
	{
	    logmsg(L_WARNING, "extractLynx: inconsistent file, directory "
		    "block size is wrong.");
	}
	if (CbmdosFile_type(dir[i].file) == CFT_REL)
	{
	    uint8_t sidesectnum = (dir[i].blocks / 120)
		+ !!(dir[i].blocks % 120);
	    pos += 254 * sidesectnum;
	    if (pos >= size)
	    {
		logmsg(L_ERROR, "extractLynx: unexpected end of file.");
		goto done;
	    }
	}
	if (i == numfiles - 1 && !dir[i].size)
	{
	    dir[i].size = size - pos;
	    if (dir[i].size < (dir[i].blocks-1U) * 254)
	    {
		logmsg(L_ERROR, "extractLynx: unexpected end of file.");
		goto done;
	    }
	    if (dir[i].size > dir[i].blocks * 254)
	    {
		logmsg(L_WARNING, "extractLynx: unexpected garbage after end "
			"of file, archive might be corrupt.");
		dir[i].size = dir[i].blocks * 254;
	    }
	}
	if (pos + dir[i].size > size)
	{
	    logmsg(L_ERROR, "extractLynx: unexpected end of file.");
	    goto done;
	}
	if (FileData_append(CbmdosFile_data(dir[i].file),
		    content + pos, dir[i].size) < 0)
	{
	    logmsg(L_ERROR, "extractLynx: error writing file.");
	    goto done;
	}
	pos += dir[i].size;
    }
    if (pos < size)
    {
	size_t pad = 254 - (pos%254);
	if (pos + pad != size)
	{
	    logmsg(L_WARNING,
		    "extractLynx: file doesn't have the expected size");
	}
    }

    for (int i = 0; i < numfiles; ++i)
    {
	if (CbmdosVfs_append(vfs, dir[i].file) < 0)
	{
	    logmsg(L_ERROR, "extractLynx: error adding file to filesystem.");
	    goto done;
	}
	else dir[i].file = 0;
    }

    rc = 0;

done:
    for (int i = 0; i < numfiles; ++i) CbmdosFile_destroy(dir[i].file);
    free(dir);
    return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5550
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x56a0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %r8
leaq -0x30(%rbp), %rdi
leaq -0x31(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0xfa20
cmpl $0x0, %eax
jge 0xfc98
movl $0x1, %edi
leaq 0x48e1(%rip), %rsi      # 0x14568
callq 0x5a60
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x10629
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x5340
movq -0x40(%rbp), %rax
subq -0x30(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x98(%rbp)
cmpq $0x50, -0x98(%rbp)
jb 0xfcd3
movq $0x4f, -0x98(%rbp)
leaq -0x90(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq -0x30(%rbp), %rsi
movq -0x98(%rbp), %rdx
callq 0x54c0
leaq -0x90(%rbp), %rdx
movl $0x3, %edi
leaq 0x488b(%rip), %rsi      # 0x1458c
movb $0x0, %al
callq 0x5ab0
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x9a(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x10640
cmpl $0x0, %eax
jge 0xfd42
movl $0x1, %edi
leaq 0x487e(%rip), %rsi      # 0x145af
callq 0x5a60
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x10629
movzwl -0x9a(%rbp), %eax
imulq $0x18, %rax, %rdi
callq 0x58d0
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
movzwl -0x9a(%rbp), %eax
imulq $0x18, %rax, %rdx
xorl %esi, %esi
callq 0x5340
movl $0xffffffff, -0xac(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xb0(%rbp)
movl -0xb0(%rbp), %eax
movzwl -0x9a(%rbp), %ecx
cmpl %ecx, %eax
jge 0x10183
movb $0x0, -0xb1(%rbp)
movq -0x40(%rbp), %rcx
movzbl -0xb1(%rbp), %eax
addq %rax, %rcx
xorl %eax, %eax
cmpq -0x20(%rbp), %rcx
movb %al, -0xf1(%rbp)
jae 0xfde0
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movzbl -0xb1(%rbp), %edx
addq %rdx, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0xd, %eax
setne %al
movb %al, -0xf1(%rbp)
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0xfdec
jmp 0xfdfc
movb -0xb1(%rbp), %al
addb $0x1, %al
movb %al, -0xb1(%rbp)
jmp 0xfda2
movq -0x40(%rbp), %rax
movzbl -0xb1(%rbp), %ecx
addq %rcx, %rax
addq $0x1, %rax
cmpq -0x20(%rbp), %rax
jb 0xfe2a
movl $0x1, %edi
leaq 0x47bb(%rip), %rsi      # 0x145db
callq 0x5a60
jmp 0x105cb
movq -0x40(%rbp), %rax
movzbl -0xb1(%rbp), %ecx
addq %rcx, %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movzbl -0xb1(%rbp), %edx
addq %rdx, %rcx
subq $0x1, %rcx
movzbl (%rax,%rcx), %eax
cmpl $0xa0, %eax
jne 0xfe74
movb -0xb1(%rbp), %al
addb $-0x1, %al
movb %al, -0xb1(%rbp)
jmp 0xfe43
callq 0x53c0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movslq -0xb0(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0xa8(%rbp), %rax
movslq -0xb0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
addq -0x40(%rbp), %rsi
movzbl -0xb1(%rbp), %edx
callq 0x5310
movq -0xc0(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0xa8(%rbp), %rdi
movslq -0xb0(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
addq $0x8, %rdi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0x40(%rbp), %rsi
callq 0x10640
cmpl $0x0, %eax
jge 0xff10
movl $0x1, %edi
leaq 0x46fa(%rip), %rsi      # 0x14600
callq 0x5a60
jmp 0x105cb
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
jne 0xff34
movl $0x1, %edi
leaq 0x4705(%rip), %rsi      # 0x1462f
callq 0x5a60
jmp 0x105cb
movl $0x1, -0xc4(%rbp)
cmpl $0x5, -0xc4(%rbp)
jge 0xff7e
movslq -0xc4(%rbp), %rcx
leaq 0x48cb(%rip), %rax      # 0x14820
movzbl (%rax,%rcx), %eax
movq -0x28(%rbp), %rcx
movq -0x40(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0xff6b
jmp 0xff7e
jmp 0xff6d
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0xff3e
movslq -0xc4(%rbp), %rax
cmpq $0x5, %rax
jne 0xffa1
movl $0x1, %edi
leaq 0x4698(%rip), %rsi      # 0x1462f
callq 0x5a60
jmp 0x105cb
movl -0xc4(%rbp), %eax
movl %eax, -0xc8(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
cmpq -0x20(%rbp), %rax
jne 0xffd5
movl $0x1, %edi
leaq 0x4610(%rip), %rsi      # 0x145db
callq 0x5a60
jmp 0x105cb
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0xd, %eax
je 0xfffc
movl $0x1, %edi
leaq 0x463d(%rip), %rsi      # 0x1462f
callq 0x5a60
jmp 0x105cb
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
cmpq -0x20(%rbp), %rax
jne 0x10024
movl $0x1, %edi
leaq 0x45c1(%rip), %rsi      # 0x145db
callq 0x5a60
jmp 0x105cb
movq -0xa8(%rbp), %rax
movslq -0xb0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movl -0xc8(%rbp), %esi
callq 0x5110
cmpl $0x4, -0xc8(%rbp)
jne 0x100aa
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0xca(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x10640
cmpl $0x0, %eax
jge 0x10083
movl $0x1, %edi
leaq 0x45dc(%rip), %rsi      # 0x14655
callq 0x5a60
jmp 0x105cb
movq -0xa8(%rbp), %rax
movslq -0xb0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movw -0xca(%rbp), %ax
movzbl %al, %esi
callq 0x55c0
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
leaq -0xcc(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x10640
cmpl $0x0, %eax
jge 0x10123
movl -0xb0(%rbp), %eax
movzwl -0x9a(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1010b
movl $0x3, %edi
leaq 0x45a0(%rip), %rsi      # 0x14687
callq 0x5a60
movq -0xa8(%rbp), %rax
movslq -0xb0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x10(%rax)
jmp 0x10121
movl $0x1, %edi
leaq 0x45c6(%rip), %rsi      # 0x146dd
callq 0x5a60
jmp 0x105cb
jmp 0x1016d
movq -0xa8(%rbp), %rax
movslq -0xb0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzwl 0x8(%rax), %eax
subl $0x1, %eax
imull $0xfe, %eax, %eax
movzwl -0xcc(%rbp), %ecx
subl $0x1, %ecx
addl %ecx, %eax
movslq %eax, %rcx
movq -0xa8(%rbp), %rax
movslq -0xb0(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
jmp 0x1016f
movl -0xb0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb0(%rbp)
jmp 0xfd86
movl $0x0, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
movzwl -0x9a(%rbp), %ecx
cmpl %ecx, %eax
jge 0x104f3
movq -0x40(%rbp), %rax
movl $0xfe, %ecx
xorl %edx, %edx
divq %rcx
movl $0xfe, %eax
subq %rdx, %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x20(%rbp), %rax
jb 0x101ee
movl $0x1, %edi
leaq 0x43f7(%rip), %rsi      # 0x145db
callq 0x5a60
jmp 0x105cb
cmpl $0x0, -0xd0(%rbp)
jne 0x1021e
movq -0x40(%rbp), %rax
movzbl -0x31(%rbp), %ecx
imull $0xfe, %ecx, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
je 0x1021e
movl $0x2, %edi
leaq 0x44f9(%rip), %rsi      # 0x14712
callq 0x5a60
movq -0xa8(%rbp), %rax
movslq -0xd0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x57f0
cmpl $0x4, %eax
jne 0x102e5
movq -0xa8(%rbp), %rax
movslq -0xd0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzwl 0x8(%rax), %eax
movl $0x78, %ecx
cltd
idivl %ecx
movl %eax, -0xf8(%rbp)
movq -0xa8(%rbp), %rax
movslq -0xd0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzwl 0x8(%rax), %eax
movl $0x78, %ecx
cltd
idivl %ecx
movl -0xf8(%rbp), %eax
cmpl $0x0, %edx
setne %cl
xorb $-0x1, %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
addl %ecx, %eax
movb %al, -0xd9(%rbp)
movzbl -0xd9(%rbp), %eax
imull $0xfe, %eax, %eax
cltq
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x20(%rbp), %rax
jb 0x102e3
movl $0x1, %edi
leaq 0x4302(%rip), %rsi      # 0x145db
callq 0x5a60
jmp 0x105cb
jmp 0x102e5
movl -0xd0(%rbp), %eax
movzwl -0x9a(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x10424
movq -0xa8(%rbp), %rax
movslq -0xd0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
jne 0x10424
movq -0x20(%rbp), %rcx
subq -0x40(%rbp), %rcx
movq -0xa8(%rbp), %rax
movslq -0xd0(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movq -0xa8(%rbp), %rax
movslq -0xd0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0xa8(%rbp), %rcx
movslq -0xd0(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movzwl 0x8(%rcx), %ecx
subl $0x1, %ecx
imull $0xfe, %ecx, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x10396
movl $0x1, %edi
leaq 0x424f(%rip), %rsi      # 0x145db
callq 0x5a60
jmp 0x105cb
movq -0xa8(%rbp), %rax
movslq -0xd0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0xa8(%rbp), %rcx
movslq -0xd0(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movzwl 0x8(%rcx), %ecx
imull $0xfe, %ecx, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jbe 0x10422
movl $0x2, %edi
leaq 0x436f(%rip), %rsi      # 0x14751
callq 0x5a60
movq -0xa8(%rbp), %rax
movslq -0xd0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movzwl 0x8(%rax), %eax
imull $0xfe, %eax, %eax
movslq %eax, %rcx
movq -0xa8(%rbp), %rax
movslq -0xd0(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
jmp 0x10424
movq -0x40(%rbp), %rax
movq -0xa8(%rbp), %rcx
movslq -0xd0(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
addq 0x10(%rcx), %rax
cmpq -0x20(%rbp), %rax
jbe 0x1045d
movl $0x1, %edi
leaq 0x4188(%rip), %rsi      # 0x145db
callq 0x5a60
jmp 0x105cb
movq -0xa8(%rbp), %rax
movslq -0xd0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x5650
movq %rax, %rdi
movq -0x28(%rbp), %rsi
addq -0x40(%rbp), %rsi
movq -0xa8(%rbp), %rax
movslq -0xd0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdx
callq 0x5790
cmpl $0x0, %eax
jge 0x104be
movl $0x1, %edi
leaq 0x42ea(%rip), %rsi      # 0x1479e
callq 0x5a60
jmp 0x105cb
movq -0xa8(%rbp), %rax
movslq -0xd0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movl -0xd0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd0(%rbp)
jmp 0x1018d
movq -0x40(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x1053e
movq -0x40(%rbp), %rax
movl $0xfe, %ecx
xorl %edx, %edx
divq %rcx
movl $0xfe, %eax
subq %rdx, %rax
movq %rax, -0xe8(%rbp)
movq -0x40(%rbp), %rax
addq -0xe8(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0x1053c
movl $0x2, %edi
leaq 0x4288(%rip), %rsi      # 0x147bf
callq 0x5a60
jmp 0x1053e
movl $0x0, -0xec(%rbp)
movl -0xec(%rbp), %eax
movzwl -0x9a(%rbp), %ecx
cmpl %ecx, %eax
jge 0x105c1
movq -0x10(%rbp), %rdi
movq -0xa8(%rbp), %rax
movslq -0xec(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x5500
cmpl $0x0, %eax
jge 0x10592
movl $0x1, %edi
leaq 0x4265(%rip), %rsi      # 0x147f0
callq 0x5a60
jmp 0x105cb
movq -0xa8(%rbp), %rax
movslq -0xec(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
jmp 0x105b0
movl -0xec(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xec(%rbp)
jmp 0x10548
movl $0x0, -0xac(%rbp)
movl $0x0, -0xf0(%rbp)
movl -0xf0(%rbp), %eax
movzwl -0x9a(%rbp), %ecx
cmpl %ecx, %eax
jge 0x10614
movq -0xa8(%rbp), %rax
movslq -0xf0(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x50e0
movl -0xf0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf0(%rbp)
jmp 0x105d5
movq -0xa8(%rbp), %rdi
callq 0x5070
movl -0xac(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopw %cs:(%rax,%rax)