LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/Codec/CTRawCodecDecompressor.cpp
// Function: CCTRawCodec::DecompressTrack(CapsWH*, unsigned char*, int, unsigned char*)
PCAPSWH CCTRawCodec::DecompressTrack(PCAPSWH w, PUBYTE src, int slen, PUBYTE dst)
{
	CapsPack cpk;

	// get track header
	PCAPSPACK pk = GetPackHeader(&cpk, src, slen);
	if (!pk)
		return NULL;

	// use caller supplied buffer or allocate a new one
	w->rawbuf = NULL;
	FreeUncompressedTrack(w);
	w->rawlen = pk->usize;
	w->rawbuf = dst;
	if (!w->rawbuf && w->rawlen)
		w->rawbuf = new UBYTE[w->rawlen];

	// read track number
	w->ctmem = src + sizeof(CapsPack);
	w->trkcnt = CTR(w, 1);

	// read <track number> track sizes and calculate track buffer positions
	dst = w->rawbuf;
	for (int trk = 0; trk < w->trkcnt; trk++) {
		w->trklen[trk] = CTR(w, 2);
		w->trkbuf[trk] = dst;
		dst += w->trklen[trk];
	}

	// first track is stored
	if (w->trkcnt) {
		w->txsrc = w->trkbuf[0];
		w->txlen = w->trklen[0];
		memmove(w->txsrc, w->ctmem, w->txlen);
		w->ctmem += w->txlen;
	}

	// other tracks are compressed as deltas against the stored track
	for (w->txact = 1; w->txact < w->trkcnt; w->txact++)
		DecompressTrackData(w);

	return w;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %rdi
callq 0x545a
testq %rax, %rax
je 0x596a
movq %rax, %r12
movq $0x0, 0x30(%rbx)
movq %rbx, %rdi
callq 0x52e8
movl 0x4(%r12), %eax
movl %eax, 0x38(%rbx)
movq %r14, 0x30(%rbx)
testq %r14, %r14
setne %cl
testl %eax, %eax
sete %dl
orb %cl, %dl
jne 0x58a0
movslq %eax, %rdi
callq 0x4040
movq %rax, %r14
movq %rax, 0x30(%rbx)
leaq 0x19(%r15), %rax
movq %rax, 0x90(%rbx)
movzbl 0x18(%r15), %eax
movl %eax, 0x7c(%rbx)
testl %eax, %eax
je 0x595e
xorl %eax, %eax
movq 0x90(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0x90(%rbx)
movzbl (%rcx), %edx
shll $0x8, %edx
leaq 0x2(%rcx), %rsi
movq %rsi, 0x90(%rbx)
movzbl 0x1(%rcx), %ecx
orl %edx, %ecx
movl %ecx, 0x68(%rbx,%rax,4)
movq %r14, 0x40(%rbx,%rax,8)
addq %rcx, %r14
incq %rax
movslq 0x7c(%rbx), %rcx
cmpq %rcx, %rax
jl 0x58bd
testl %ecx, %ecx
je 0x595e
movq 0x40(%rbx), %rdi
movq 0x90(%rbx), %rsi
movq %rdi, 0x98(%rbx)
movslq 0x68(%rbx), %rdx
movl %edx, 0xa0(%rbx)
callq 0x4330
movslq 0xa0(%rbx), %rax
addq %rax, 0x90(%rbx)
cmpl $0x2, 0x7c(%rbx)
movl $0x1, 0xa4(%rbx)
jl 0x596c
movq %rbx, %rdi
callq 0x59a8
movl 0xa4(%rbx), %eax
incl %eax
movl %eax, 0xa4(%rbx)
cmpl 0x7c(%rbx), %eax
jl 0x5941
jmp 0x596c
movl $0x1, 0xa4(%rbx)
jmp 0x596c
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/Codec/CTRawCodecDecompressor.cpp
// Function: CCTRawCodec::CTR(CapsWH*, int)
UDWORD CCTRawCodec::CTR(PCAPSWH w, int size)
{
	UDWORD res = 0;

	for (; size; size--) {
		res <<= 8;
		res |= *w->ctmem++;
	}

	return res;
}

// Assembly:
testl %esi, %esi
je 0x59a4
movq 0x90(%rdi), %rcx
incq %rcx
xorl %eax, %eax
shll $0x8, %eax
movq %rcx, 0x90(%rdi)
movzbl -0x1(%rcx), %edx
orl %edx, %eax
incq %rcx
decl %esi
jne 0x598c
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/Codec/CTRawCodecDecompressor.cpp
// Function: CCTRawCodec::DecompressTrackData(CapsWH*)
void CCTRawCodec::DecompressTrackData(PCAPSWH w)
{
	// source stream
	PUBYTE src = w->ctmem;

	// destination buffer
	PUBYTE dst = w->trkbuf[w->txact];

	// end of destination buffer
	PUBYTE max = dst + w->trklen[w->txact];

	// first, stored track
	PUBYTE mem = w->txsrc;

	// decode the data, see compressor for encoding
	while (dst < max) {
		UDWORD size = *src++;

		if (size & 0x80) {
			// copy block
			// 3 bit shift
			int shift = size >> 4 & 7;

			// 12 bit size
			size = ((size & 0xf) << 8) | (*src++);

			// 16 bit offset
			UDWORD ofs = *src++;
			ofs = (ofs << 8) | (*src++);
			PUBYTE buf = mem + ofs;

			if (shift) {
				// bitshift copy
				ofs = *buf++;
				while (size--) {
					ofs = (ofs << 8) | (*buf++);
					*dst++ = (UBYTE)(ofs >> shift);
				}
			} else {
				// simple copy
				while (size--)
					*dst++ = *buf++;
			}
		} else {
			// data block, 15 bit size
			size = (size << 8) | (*src++);
			while (size--)
				*dst++ = *src++;
		}
	}

	// update the source stream position
	w->ctmem = src;
}

// Assembly:
movq 0x90(%rdi), %r8
movslq 0xa4(%rdi), %rcx
movslq 0x68(%rdi,%rcx,4), %rax
testq %rax, %rax
jle 0x5ac1
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movq 0x98(%rdi), %rdx
movq 0x40(%rdi,%rcx,8), %r9
addq %r9, %rax
leaq 0x1(%rdx), %rsi
movzbl (%r8), %r10d
testb %r10b, %r10b
js 0x5a1a
shll $0x8, %r10d
movzbl 0x1(%r8), %r11d
addq $0x2, %r8
orl %r10d, %r11d
je 0x5aa4
leaq 0x1(%r8), %rcx
leaq 0x1(%r9), %r10
movb (%r8), %r8b
movb %r8b, (%r9)
movq %rcx, %r8
movq %r10, %r9
decl %r11d
jne 0x59fc
jmp 0x5aaa
movl %r10d, %ecx
shrl $0x4, %ecx
andl $0xf, %r10d
shll $0x8, %r10d
movzbl 0x1(%r8), %ebx
leal (%r10,%rbx), %ebp
movzbl 0x2(%r8), %r11d
shll $0x8, %r11d
movzbl 0x3(%r8), %r14d
addq $0x4, %r8
andl $0x7, %ecx
je 0x5a82
testl %ebp, %ebp
je 0x5aa4
leaq (%r11,%r14), %r15
movzbl (%rdx,%r15), %ebp
addq %r14, %r11
addq %rsi, %r11
addl %ebx, %r10d
xorl %ebx, %ebx
shll $0x8, %ebp
movzbl (%r11,%rbx), %r14d
orl %r14d, %ebp
movl %ebp, %r14d
shrl %cl, %r14d
movb %r14b, (%r9,%rbx)
incq %rbx
cmpl %ebx, %r10d
jne 0x5a60
addq %rbx, %r9
jmp 0x5aa4
testl %ebp, %ebp
je 0x5aa4
addq %r14, %r11
addq %rdx, %r11
addl %ebx, %r10d
xorl %ecx, %ecx
movb (%r11,%rcx), %bl
movb %bl, (%r9,%rcx)
incq %rcx
cmpl %ecx, %r10d
jne 0x5a91
addq %rcx, %r9
movq %r9, %r10
movq %r8, %rcx
movq %rcx, %r8
movq %r10, %r9
cmpq %rax, %r10
jb 0x59dd
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5ac4
movq %r8, %rcx
movq %rcx, 0x90(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSAddImage()
SDWORD __cdecl CAPSAddImage()
{
	// use the base image type as a placeholder, returning errors for the functions
	PCDISKIMAGE pi = new CDiskImage;
	unsigned pos;

	for (pos = 0; pos < img.size(); pos++) {
		if (img[pos])
			continue;

		img[pos] = pi;
		return pos;
	}

	img.push_back(pi);

	return pos;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl $0xb8, %edi
callq 0x4200
movq %rax, %rbx
movq %rax, %rdi
callq 0xe71c
movq 0x149ed(%rip), %rsi     # 0x1a518
movq 0x149de(%rip), %rax     # 0x1a510
movq %rsi, %rcx
movq %rbx, (%rsp)
subq %rax, %rcx
je 0x5b56
sarq $0x3, %rcx
xorl %r14d, %r14d
cmpq $0x0, (%rax,%r14,8)
je 0x5b6f
incl %r14d
cmpq %r14, %rcx
ja 0x5b45
jmp 0x5b59
xorl %r14d, %r14d
cmpq 0x149c0(%rip), %rsi     # 0x1a520
je 0x5b75
movq %rbx, (%rsi)
addq $0x8, 0x149ab(%rip)     # 0x1a518
jmp 0x5b84
movq %rbx, (%rax,%r14,8)
jmp 0x5b84
leaq 0x14994(%rip), %rdi     # 0x1a510
movq %rsp, %rdx
callq 0x6500
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
movl $0xb8, %esi
movq %rbx, %rdi
callq 0x4210
movq %r14, %rdi
callq 0x43a0
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSRemImage(int)
SDWORD __cdecl CAPSRemImage(SDWORD id)
{
	if (id<0 || (unsigned)id>=img.size())
		return -1;

	delete img[id];
	img[id]=NULL;
	return id;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %edi, %edi
js 0x5bfa
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movl %edi, %r14d
movq 0x14958(%rip), %rdx     # 0x1a518
movq 0x14949(%rip), %rcx     # 0x1a510
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
jbe 0x5bf3
movq (%rcx,%r14,8), %rdi
testq %rdi, %rdi
je 0x5be9
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x14927(%rip), %rcx     # 0x1a510
movq $0x0, (%rcx,%r14,8)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSLockImage(int, char*)
SDWORD __cdecl CAPSLockImage(SDWORD id, PCHAR name)
{
	if (id<0 || (unsigned)id >= img.size() || !img[id])
		return imgeOutOfRange;

	CapsFile cf;
	memset(&cf, 0, sizeof(CapsFile));
	cf.name=name;

	return CAPSLockImage(id, &cf);
}

// Assembly:
movl $0x3, %eax
testl %edi, %edi
js 0x5c44
movl %edi, %ecx
movq 0x1490b(%rip), %r8      # 0x1a518
movq 0x148fc(%rip), %rdx     # 0x1a510
subq %rdx, %r8
sarq $0x3, %r8
cmpq %rcx, %r8
jbe 0x5c44
cmpq $0x0, (%rdx,%rcx,8)
je 0x5c44
subq $0x18, %rsp
xorps %xmm0, %xmm0
movq %rsp, %rax
movups %xmm0, 0x8(%rax)
movq %rsi, (%rax)
movq %rax, %rsi
callq 0x5c45
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSLockImage(int, CapsFile*)
int CAPSLockImage(int id, PCAPSFILE pcf)
{
	int res = imgeOk;

	// get the possible image type used by the file
	int type = imgfactory.GetImageType(pcf);

	// check for file errors
	switch (type) {
		// problem with the file
		case citError:
			res = imgeOpen;
			break;

		// unknown file content
		case citUnknown:
			res = imgeType;
			break;
	}

	// file type is known and supported
	if (res == imgeOk) {
		PCDISKIMAGE newimg = imgfactory.CreateImage(type);

		if (newimg) {
			// delete the existing image class regardless of type since it can no longer be used
			CAPSRemImage(id);

			// add the new image class
			img[id] = newimg;

			// try to lock the file; this can still give an error as the checks will be more thorough
			res = img[id]->Lock(pcf);
		} else
			res = imgeGeneric;
	}

	return res;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movq %rsi, %rdi
callq 0xf3d0
testl %eax, %eax
je 0x5c66
cmpl $0x1, %eax
jne 0x5c6d
movl $0x6, %eax
jmp 0x5cb1
movl $0x5, %eax
jmp 0x5cb1
movl %eax, %edi
callq 0xf67e
testq %rax, %rax
je 0x5cac
movq %rax, %r14
movl %ebp, %edi
callq 0x5ba7
movslq %ebp, %rax
movq 0x14883(%rip), %rcx     # 0x1a510
movq %r14, (%rcx,%rax,8)
movq 0x14878(%rip), %rcx     # 0x1a510
movq (%rcx,%rax,8), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
movl $0x2, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSLockImageMemory(int, unsigned char*, unsigned int, unsigned int)
SDWORD __cdecl CAPSLockImageMemory(SDWORD id, PUBYTE buffer, UDWORD length, UDWORD flag)
{
	if (id<0 || (unsigned)id >= img.size() || !img[id])
		return imgeOutOfRange;

	CapsFile cf;
	memset(&cf, 0, sizeof(CapsFile));
	cf.memmap=buffer;
	cf.size=length;
	cf.flag|=CFF_MEMMAP;
	if (flag & DI_LOCK_MEMREF)
		cf.flag|=CFF_MEMREF;

	return CAPSLockImage(id, &cf);
}

// Assembly:
movl $0x3, %eax
testl %edi, %edi
js 0x5d14
movl %edi, %r8d
movq 0x1484f(%rip), %r10     # 0x1a518
movq 0x14840(%rip), %r9      # 0x1a510
subq %r9, %r10
sarq $0x3, %r10
cmpq %r8, %r10
jbe 0x5d14
cmpq $0x0, (%r9,%r8,8)
je 0x5d14
subq $0x18, %rsp
movq %rsp, %rax
movq $0x0, (%rax)
movq %rsi, 0x8(%rax)
movl %edx, 0x14(%rax)
shrb $0x7, %cl
movzbl %cl, %ecx
leal 0x2(,%rcx,4), %ecx
movl %ecx, 0x10(%rax)
movq %rax, %rsi
callq 0x5c45
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSUnlockImage(int)
SDWORD __cdecl CAPSUnlockImage(SDWORD id)
{
	if (id<0 || (unsigned)id >= img.size() || !img[id])
		return imgeOutOfRange;

	int res=img[id]->Unlock();

	return res;
}

// Assembly:
testl %edi, %edi
js 0x5d44
movl %edi, %eax
movq 0x147f6(%rip), %rdx     # 0x1a518
movq 0x147e7(%rip), %rcx     # 0x1a510
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rax, %rdx
jbe 0x5d44
movq (%rcx,%rax,8), %rdi
testq %rdi, %rdi
je 0x5d44
movq (%rdi), %rax
jmpq *0x18(%rax)
movl $0x3, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSLoadImage(int, unsigned int)
SDWORD __cdecl CAPSLoadImage(SDWORD id, UDWORD flag)
{
	if (id<0 || (unsigned)id >= img.size() || !img[id])
		return imgeOutOfRange;

	int res=img[id]->LoadImage(flag);

	return res;
}

// Assembly:
testl %edi, %edi
js 0x5d7e
movl %edi, %eax
movq 0x147c1(%rip), %rdx     # 0x1a518
movq 0x147b2(%rip), %rcx     # 0x1a510
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rax, %rdx
jbe 0x5d7e
movq (%rcx,%rax,8), %rdi
testq %rdi, %rdi
je 0x5d7e
movq (%rdi), %rax
movq 0x20(%rax), %rax
xorl %edx, %edx
jmpq *%rax
movl $0x3, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSGetImageInfo(CapsImageInfo*, int)
SDWORD __cdecl CAPSGetImageInfo(PCAPSIMAGEINFO pi, SDWORD id)
{
	if (!pi)
		return imgeGeneric;

	memset(pi, 0, sizeof(CapsImageInfo));

	if (id<0 || (unsigned)id >= img.size() || !img[id])
		return imgeOutOfRange;

	PDISKIMAGEINFO pd=img[id]->GetInfo();
	if (!pd)
		return imgeGeneric;

	// convert image info
	if (pd->civalid) {
		// use image info if available
		switch (pd->ci.type) {
			case cpimtFDD:
				pi->type = ciitFDD;
				break;

			default:
				pi->type = ciitNA;
				break;
		}

		pi->release = pd->ci.release;
		pi->revision = pd->ci.revision;
		pi->mincylinder = pd->ci.mincylinder;
		pi->maxcylinder = pd->ci.maxcylinder;
		pi->minhead = pd->ci.minhead;
		pi->maxhead = pd->ci.maxhead;
		CDiskImage::DecodeDateTime(&pi->crdt, &pd->ci.crdt);

		for (int plt = 0; plt < CAPS_MAXPLATFORM; plt++)
			pi->platform[plt] = pd->ci.platform[plt];
	} else {
		// image info not available
		if (pd->dmpcount) {
			// if there is at least one track dumped use dump information
			pi->type = ciitFDD;
			pi->release = 0;
			pi->revision = 0;
			pi->mincylinder = pd->umincylinder;
			pi->maxcylinder = pd->umaxcylinder;
			pi->minhead = pd->uminhead;
			pi->maxhead = pd->umaxhead;
		}	else {
			// invalid image type if not a dumped image and there is no information available
			pi->type = ciitNA;
		}
	}

	return imgeOk;
}

// Assembly:
movl $0x2, %eax
testq %rdi, %rdi
je 0x5e6e
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq $0x0, 0x40(%rdi)
movl $0x3, %eax
testl %esi, %esi
js 0x5e67
movl %esi, %ecx
movq 0x1474f(%rip), %rsi     # 0x1a518
movq 0x14740(%rip), %rdx     # 0x1a510
subq %rdx, %rsi
sarq $0x3, %rsi
cmpq %rcx, %rsi
jbe 0x5e67
movq (%rdx,%rcx,8), %r14
testq %r14, %r14
je 0x5e67
cmpl $0x0, 0x8(%r14)
movl $0x2, %eax
je 0x5e67
cmpl $0x0, 0x48(%r14)
je 0x5e48
xorl %eax, %eax
cmpl $0x1, 0x4c(%r14)
sete %al
movl %eax, (%rbx)
movsd 0x64(%r14), %xmm0
movsd 0x58(%r14), %xmm1
movlhps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movups %xmm1, 0x4(%rbx)
movq 0x6c(%r14), %rax
movq %rax, 0x14(%rbx)
leaq 0x1c(%rbx), %rdi
leaq 0x74(%r14), %rsi
callq 0xf010
xorl %eax, %eax
xorl %ecx, %ecx
movl 0x7c(%r14,%rcx,4), %edx
movl %edx, 0x38(%rbx,%rcx,4)
incq %rcx
cmpq $0x4, %rcx
jne 0x5e34
jmp 0x5e67
xorl %eax, %eax
cmpl $0x0, 0x30(%r14)
je 0x5e67
movl $0x1, (%rbx)
movl $0x0, 0x8(%rbx)
movups 0x20(%r14), %xmm0
movups %xmm0, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSLockTrackT0(CapsTrackInfo*, DiskTrackInfo*, unsigned int, unsigned int)
void CAPSLockTrackT0(PCAPSTRACKINFO pi, PDISKTRACKINFO pt, UDWORD ttype, UDWORD flag)
{
	pi->type=ttype;
	pi->cylinder=pt->cylinder;
	pi->head=pt->head;
	pi->sectorcnt=pt->sectorcnt;
	pi->sectorsize=0;
	pi->trackcnt=pt->trackcnt;
	pi->trackbuf=pt->trackbuf;
	pi->tracklen=(flag & DI_LOCK_TRKBIT) ? pt->trackbc : pt->tracklen;
	pi->timelen=pt->timecnt;
	pi->timebuf=pt->timebuf;

	for (int trk=0; trk < pt->trackcnt; trk++) {
		pi->trackdata[trk]=pt->trackdata[trk];
		pi->tracksize[trk]=pt->tracksize[trk];
	}
}

// Assembly:
movl %edx, (%rdi)
movq 0x10(%rsi), %rax
movq %rax, 0x4(%rdi)
movl 0x18(%rsi), %eax
movl %eax, 0xc(%rdi)
movl $0x0, 0x10(%rdi)
movl 0x28(%rsi), %eax
movl %eax, 0x14(%rdi)
movq 0x48(%rsi), %rdx
leaq 0xe8(%rsi), %r8
btl $0xc, %ecx
leaq 0x50(%rsi), %rcx
cmovaeq %rcx, %r8
movq %rdx, 0x18(%rdi)
movl (%r8), %ecx
movl %ecx, 0x20(%rdi)
movl 0xa8(%rsi), %ecx
movl %ecx, 0x60(%rdi)
movq 0xb0(%rsi), %rcx
movq %rcx, 0x64(%rdi)
testl %eax, %eax
jle 0x6077
xorl %eax, %eax
movq 0x58(%rsi,%rax,8), %rcx
movq %rcx, 0x24(%rdi,%rax,8)
movl 0x80(%rsi,%rax,4), %ecx
movl %ecx, 0x4c(%rdi,%rax,4)
incq %rax
movslq 0x28(%rsi), %rcx
cmpq %rcx, %rax
jl 0x6056
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSUnlockTrack(int, unsigned int, unsigned int)
SDWORD __cdecl CAPSUnlockTrack(SDWORD id, UDWORD cylinder, UDWORD head)
{
	if (id<0 || (unsigned)id >= img.size() || !img[id])
		return imgeOutOfRange;

	PDISKTRACKINFO pt=img[id]->UnlockTrack(cylinder, head);

	return pt ? imgeOk : imgeOutOfRange;
}

// Assembly:
movl $0x3, %eax
testl %edi, %edi
js 0x6182
movl %edi, %ecx
movq 0x143c9(%rip), %r8      # 0x1a518
movq 0x143ba(%rip), %rdi     # 0x1a510
subq %rdi, %r8
sarq $0x3, %r8
cmpq %rcx, %r8
jbe 0x6182
movq (%rdi,%rcx,8), %rdi
testq %rdi, %rdi
je 0x6182
pushq %rax
xorl %ecx, %ecx
callq 0xe9c6
xorl %ecx, %ecx
testq %rax, %rax
sete %cl
leal (%rcx,%rcx,2), %eax
addq $0x8, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSUnlockAllTracks(int)
SDWORD __cdecl CAPSUnlockAllTracks(SDWORD id)
{
	if (id<0 || (unsigned)id >= img.size() || !img[id])
		return imgeOutOfRange;

	img[id]->UnlockTrack();

	return imgeOk;
}

// Assembly:
pushq %rbx
movl $0x3, %ebx
testl %edi, %edi
js 0x61bb
movl %edi, %eax
movq 0x14382(%rip), %rdx     # 0x1a518
movq 0x14373(%rip), %rcx     # 0x1a510
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rax, %rdx
jbe 0x61bb
movq (%rcx,%rax,8), %rdi
testq %rdi, %rdi
je 0x61bb
xorl %ebx, %ebx
xorl %esi, %esi
callq 0xe912
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSGetVersionInfo(void*, unsigned int)
SDWORD __cdecl CAPSGetVersionInfo(PVOID pversioninfo, UDWORD flag)
{
	if (!pversioninfo)
		return imgeGeneric;

	// structure revision is zero, unless newer one requested
	unsigned rev=0;
	if (flag & DI_LOCK_TYPE)
		rev=*(PUDWORD)pversioninfo;

	// if unsupported type set the highest supported version
	if (rev > 0) {
		*(PUDWORD)pversioninfo=0;
		return imgeUnsupportedType;
	}

	// clear structure
	memset(pversioninfo, 0, sizeversioninfo[rev]);

	// get the correct structure
	switch (rev) {
		case 0:
			CAPSGetVersionInfoT0((PCAPSVERSIONINFO)pversioninfo);
			break;
	}

	return imgeOk;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x6211
movq %rdi, %rbx
btl $0x9, %esi
jae 0x61e7
cmpl $0x0, (%rbx)
je 0x61e7
movl $0x0, (%rbx)
movl $0xf, %ebp
jmp 0x6216
movslq 0x13036(%rip), %rdx     # 0x19224
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4140
movabsq $0x100000005, %rax      # imm = 0x100000005
movq %rax, 0x4(%rbx)
movl $0x7fff, 0xc(%rbx)      # imm = 0x7FFF
jmp 0x6216
movl $0x2, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSGetInfo(void*, int, unsigned int, unsigned int, unsigned int, unsigned int)
SDWORD __cdecl CAPSGetInfo(PVOID pinfo, SDWORD id, UDWORD cylinder, UDWORD head, UDWORD inftype, UDWORD infid)
{
	if (!pinfo)
		return imgeGeneric;

	if (id<0 || (unsigned)id >= img.size() || !img[id])
		return imgeOutOfRange;

	PDISKIMAGEINFO pd = img[id]->GetInfo();
	PDISKTRACKINFO pt = img[id]->GetTrack(cylinder, head);

	int res=imgeUnsupportedType;

	switch (inftype) {
		case cgiitSector:
			res=CAPSGetSectorInfo((PCAPSSECTORINFO)pinfo, pd, pt, infid);
			break;

		case cgiitWeak:
			res=CAPSGetWeakInfo((PCAPSDATAINFO)pinfo, pd, pt, infid);
			break;

		case cgiitRevolution:
			res = CAPSGetRevolutionInfo((PCAPSREVOLUTIONINFO)pinfo, pd, pt, infid);
			break;
	}

	return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x62c3
movl $0x3, %ebx
testl %esi, %esi
js 0x62c8
movq %rdi, %r14
movl %esi, %eax
movq 0x142be(%rip), %rdi     # 0x1a518
movq 0x142af(%rip), %rsi     # 0x1a510
subq %rsi, %rdi
sarq $0x3, %rdi
cmpq %rax, %rdi
jbe 0x62c8
movq (%rsi,%rax,8), %r12
testq %r12, %r12
je 0x62c8
movl %r9d, %ebp
movl %r8d, %r15d
movl 0x8(%r12), %r13d
movq %r12, %rdi
movl %edx, %esi
movl %ecx, %edx
callq 0xebea
cmpl $0x3, %r15d
je 0x6327
cmpl $0x2, %r15d
je 0x62d9
movl $0xf, %ebx
cmpl $0x1, %r15d
jne 0x62c8
movq %r14, %rdi
movq %rax, %rdx
movl %ebp, %ecx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6368
movl $0x2, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x0, 0x8(%r14)
movq $0x0, (%r14)
testq %rax, %rax
je 0x62c8
movl 0xd0(%rax), %ecx
testl %ecx, %ecx
jle 0x62c8
movq 0xd8(%rax), %rax
testq %rax, %rax
sete %dl
cmpl %ebp, %ecx
setbe %cl
orb %dl, %cl
jne 0x62c8
movl %ebp, %ecx
movl $0x1, (%r14)
leaq (%rcx,%rcx,2), %rcx
movq 0x4(%rax,%rcx,4), %rax
movq %rax, 0x4(%r14)
xorl %ebx, %ebx
jmp 0x62c8
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
testl %r13d, %r13d
je 0x6344
movq 0x3c(%r12), %rcx
movq %rcx, (%r14)
movl 0x44(%r12), %ecx
movl %ecx, 0x8(%r14)
xorl %ebx, %ebx
testq %rax, %rax
je 0x62c8
cmpl $0x0, 0x44(%rax)
je 0x635a
movl 0x2c(%rax), %eax
jmp 0x635f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, 0xc(%r14)
jmp 0x62c8
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSGetWeakInfo(CapsDataInfo*, DiskImageInfo*, DiskTrackInfo*, unsigned int)
int CAPSGetWeakInfo(PCAPSDATAINFO pi, PDISKIMAGEINFO pd, PDISKTRACKINFO pt, UDWORD infid)
{
	memset(pi, 0, sizeof(CapsDataInfo));

	if (!pt)
		return imgeOutOfRange;

	if (pt->fdpsize <= 0 || !pt->fdp)
		return imgeOutOfRange;

	if (infid >= (unsigned)pt->fdpsize)
		return imgeOutOfRange;

	PDISKDATAMARK dm=pt->fdp+infid;

	pi->type=cditWeak;
	pi->start=dm->position;
	pi->size=dm->size;

	return imgeOk;
}

// Assembly:
movl $0x0, 0x8(%rdi)
movq $0x0, (%rdi)
movl $0x3, %eax
testq %rdx, %rdx
je 0x641b
movl 0xd0(%rdx), %esi
testl %esi, %esi
jle 0x641b
movq 0xd8(%rdx), %rdx
testq %rdx, %rdx
sete %r8b
cmpl %ecx, %esi
setbe %sil
orb %r8b, %sil
jne 0x641b
movl %ecx, %eax
movl $0x1, (%rdi)
leaq (%rax,%rax,2), %rax
movq 0x4(%rdx,%rax,4), %rax
movq %rax, 0x4(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSSetRevolution(int, unsigned int)
SDWORD __cdecl CAPSSetRevolution(SDWORD id, UDWORD value)
{
	if (id<0 || (unsigned)id >= img.size() || !img[id])
		return imgeOutOfRange;

	PDISKIMAGEINFO pd = img[id]->GetInfo();
	if (!pd)
		return imgeGeneric;

	// set revolution
	pd->nextrev = value;

	return imgeOk;
}

// Assembly:
movl $0x3, %eax
testl %edi, %edi
js 0x6488
movl %edi, %ecx
movq 0x140b7(%rip), %rdi     # 0x1a518
movq 0x140a8(%rip), %rdx     # 0x1a510
subq %rdx, %rdi
sarq $0x3, %rdi
cmpq %rcx, %rdi
jbe 0x6488
movq (%rdx,%rcx,8), %rcx
testq %rcx, %rcx
je 0x6488
cmpl $0x0, 0x8(%rcx)
je 0x6489
movl %esi, 0x3c(%rcx)
xorl %eax, %eax
retq
movl $0x2, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsAPI.cpp
// Function: CAPSGetImageTypeMemory(unsigned char*, unsigned int)
SDWORD __cdecl CAPSGetImageTypeMemory(PUBYTE buffer, UDWORD length)
{
	CapsFile cf;
	memset(&cf, 0, sizeof(CapsFile));
	cf.memmap = buffer;
	cf.size = length;
	cf.flag |= CFF_MEMMAP | CFF_MEMREF;

	// get the possible image type used by the file
	return imgfactory.GetImageType(&cf);
}

// Assembly:
subq $0x18, %rsp
movq %rsp, %rax
movq $0x0, (%rax)
movq %rdi, 0x8(%rax)
movl %esi, 0x14(%rax)
movl $0x6, 0x10(%rax)
movq %rax, %rdi
callq 0xf3d0
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcComT1_SpinupLoop(CapsFdc*)
void FdcComT1_SpinupLoop(PCAPSFDC pc)
{
	// clock cycles to complete
	UDWORD cmax=pc->clockreq-pc->clockact;

	// if no drive selected run all cycles index can't happen
	if (!pc->driveprc) {
		FdcComIdle(pc, cmax);
		return;
	}

	// if index can't happen on enabled drive run all cycles
	PCAPSDRIVE pd=pc->driveprc;
	if ((pd->diskattr & CAPSDRIVE_DA_IPMASK) != CAPSDRIVE_DA_IPMASK) {
		FdcComIdle(pc, cmax);
		return;
	}

	// if index or spin-up event won't happen, run it all
	if ((pd->idistance+cmax<pd->clockrev) || (pc->spinupcnt+1 < pc->spinuplimit)){
		FdcComIdle(pc, cmax);
		return;
	}

	// cycles until index
	cmax=pd->clockrev-pd->idistance;

	// index and spin-up happens now, only run cycles until index
	if (FdcComIdle(pc, cmax) != cmax)
		return;

	// end loop, but only if wait was complete
	pc->runstate++;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x10(%rdi), %esi
subl 0xc(%rdi), %esi
movq 0x100(%rdi), %rcx
testq %rcx, %rcx
je 0x66e3
movl 0x20(%rcx), %eax
notl %eax
testb $0x5, %al
jne 0x66e3
movl 0x24(%rcx), %eax
movl 0x28(%rcx), %ebp
leal (%rax,%rsi), %ecx
cmpl %ebp, %ecx
jb 0x66e3
movl 0xa4(%rbx), %ecx
incl %ecx
cmpl 0xa8(%rbx), %ecx
jge 0x66f1
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x7861
subl %eax, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x7861
cmpl %ebp, %eax
jne 0x6704
incl 0x2c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcComT1_VerifyStart(CapsFdc*)
void FdcComT1_VerifyStart(PCAPSFDC pc)
{
	// reset logic
	FdcResetData(pc);

	// set abort on maximum revolutions for verify
	pc->indexlimit=pc->verifylimit;

	// set loop
	pc->runstate++;
}

// Assembly:
xorl %eax, %eax
movl %eax, 0x50(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x6c(%rdi)
movl %eax, 0x7c(%rdi)
movaps 0xb88e(%rip), %xmm0     # 0x12140
movups %xmm0, 0x5c(%rdi)
movss 0xb8f2(%rip), %xmm0     # 0x121b0
movups %xmm0, 0x80(%rdi)
movq $0x0, 0x90(%rdi)
movl 0xa0(%rdi), %eax
movl %eax, 0x98(%rdi)
incl 0x2c(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcComT1_VerifyLoop(CapsFdc*)
void FdcComT1_VerifyLoop(PCAPSFDC pc)
{
	// update data access
	FdcUpdateData(pc);

	// get access hook, crc
	FDCREAD ph=FdcGetReadAccess(pc);

	// clock cycles to complete
	UDWORD cst=pc->clockact;

	// process requested cycles
	while (!pc->endrequest && pc->clockact<pc->clockreq) {
		// read byte when ready
		if (!ph(pc))
			continue;

		// check ID
		switch (pc->dataphase) {
			case 0:
				// AM detected, read returns on dsr ready
				pc->amisigmask=CAPSFDC_AI_DSRREADY;
				pc->dataphase++;
				break;

			case 1:
				//if not fc...ff, restart
				if (pc->dsr < 0xfc) {
					FdcResetAm(pc);
					continue;
				}

				pc->dataphase++;
				break;

			case 2:
				//if not the track, restart
				if (pc->dsr != pc->r_track) {
					FdcResetAm(pc);
					continue;
				}

				pc->dataphase++;
				break;

			// skip rest ofID
			case 3:
			case 4:
			case 5:
			case 6:
				pc->dataphase++;
				break;

			case 7:
				// if crc error, set crc flag, restart
				if (pc->crc & 0xffff) {
					FdcResetAm(pc);
					pc->r_st0|=CAPSFDC_SR_CRCERR;
					continue;
				}

				// clear crc flag, stop
				pc->r_st0&=~CAPSFDC_SR_CRCERR;

				// run cycles used on unselected drives
				FdcComIdleOther(pc, pc->clockact-cst);

				// end
				pc->endrequest|=CAPSFDC_ER_COMEND;
				return;

			default:
				NODEFAULT;
		}
	}

	// end requested, set seek error
	if (pc->endrequest & CAPSFDC_ER_COMEND)
		pc->r_st0|=CAPSFDC_SR_RNF;

	// run cycles on unselected drives
	FdcComIdleOther(pc, pc->clockact-cst);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x792a
movl 0x8(%rbx), %eax
movl 0xc(%rbx), %ebp
testl %eax, %eax
je 0x6918
testb $0x1, %al
je 0x6901
orb $0x10, 0x30(%rbx)
movl 0xc(%rbx), %esi
subl %ebp, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7a30
movslq 0x84(%rbx), %rax
leaq 0x120da(%rip), %rcx     # 0x18a00
movq (%rcx,%rax,8), %r14
leaq 0xb74b(%rip), %r15      # 0x1207c
movl 0xc(%rbx), %eax
cmpl 0x10(%rbx), %eax
jae 0x6901
movq %rbx, %rdi
callq *%r14
testl %eax, %eax
je 0x695a
movl 0x8c(%rbx), %eax
movslq (%r15,%rax,4), %rcx
addq %r15, %rcx
jmpq *%rcx
incl %eax
movl %eax, 0x8c(%rbx)
movl 0x8(%rbx), %eax
testl %eax, %eax
je 0x6931
jmp 0x68f9
movl 0x78(%rbx), %eax
cmpl 0x40(%rbx), %eax
jne 0x69be
movl $0x3, 0x8c(%rbx)
jmp 0x695a
cmpw $0x0, 0x54(%rbx)
je 0x69f0
movl 0x60(%rbx), %eax
andl $-0x10, %eax
orl $0x3, %eax
movl %eax, 0x60(%rbx)
movl $0x200, 0x64(%rbx)      # imm = 0x200
movq $0x0, 0x8c(%rbx)
orb $0x8, 0x30(%rbx)
jmp 0x695a
movl $0x100, 0x64(%rbx)      # imm = 0x100
movl $0x1, 0x8c(%rbx)
jmp 0x695a
cmpl $0xfb, 0x78(%rbx)
ja 0x69e1
movl 0x60(%rbx), %eax
andl $-0x10, %eax
orl $0x3, %eax
movl %eax, 0x60(%rbx)
movl $0x200, 0x64(%rbx)      # imm = 0x200
movq $0x0, 0x8c(%rbx)
jmp 0x695a
movl $0x2, 0x8c(%rbx)
jmp 0x695a
andb $-0x9, 0x30(%rbx)
movl 0xc(%rbx), %esi
subl %ebp, %esi
movq %rbx, %rdi
callq 0x7a30
orb $0x1, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcComT2_ReadStart(CapsFdc*)
void FdcComT2_ReadStart(PCAPSFDC pc)
{
	// reset logic
	FdcResetData(pc);

	// set abort on maximum revolutions for verify
	pc->indexlimit=pc->readlimit;

	// set loop
	pc->runstate++;
}

// Assembly:
xorl %eax, %eax
movl %eax, 0x50(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x6c(%rdi)
movl %eax, 0x7c(%rdi)
movaps 0xb6fa(%rip), %xmm0     # 0x12140
movups %xmm0, 0x5c(%rdi)
movss 0xb75e(%rip), %xmm0     # 0x121b0
movups %xmm0, 0x80(%rdi)
movq $0x0, 0x90(%rdi)
movl 0x9c(%rdi), %eax
movl %eax, 0x98(%rdi)
incl 0x2c(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcComT3_IndexLoop(CapsFdc*)
void FdcComT3_IndexLoop(PCAPSFDC pc)
{
	// clock cycles to complete
	UDWORD cmax=pc->clockreq-pc->clockact;

	// if no drive selected run all cycles index can't happen
	if (!pc->driveprc) {
		FdcComIdle(pc, cmax);
		return;
	}

	// if index can't happen on enabled drive run all cycles
	PCAPSDRIVE pd=pc->driveprc;
	if ((pd->diskattr & CAPSDRIVE_DA_IPMASK) != CAPSDRIVE_DA_IPMASK) {
		FdcComIdle(pc, cmax);
		return;
	}

	// if index event won't happen, run it all
	if (pd->idistance+cmax < pd->clockrev){
		FdcComIdle(pc, cmax);
		return;
	}

	// cycles until index
	cmax=pd->clockrev-pd->idistance;

	// index happens now, only run cycles until index
	if (FdcComIdle(pc, cmax) != cmax)
		return;

	// end loop, but only if wait was complete
	pc->runstate++;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x10(%rdi), %esi
subl 0xc(%rdi), %esi
movq 0x100(%rdi), %rax
testq %rax, %rax
je 0x6dda
movl 0x20(%rax), %ecx
notl %ecx
testb $0x5, %cl
jne 0x6dda
movl 0x24(%rax), %ecx
movl 0x28(%rax), %ebp
leal (%rcx,%rsi), %eax
cmpl %ebp, %eax
jae 0x6de8
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x7861
subl %ecx, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x7861
cmpl %ebp, %eax
jne 0x6dfb
incl 0x2c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcComT3_ReadStart(CapsFdc*)
void FdcComT3_ReadStart(PCAPSFDC pc)
{
	// reset logic
	FdcResetData(pc);
	pc->aminfo&=~CAPSFDC_AI_CRCENABLE;
	pc->amisigmask=CAPSFDC_AI_DSRREADY;

	// abort on next index
	pc->indexlimit=1;

	// set loop
	pc->runstate++;
}

// Assembly:
xorl %eax, %eax
movl %eax, 0x50(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x6c(%rdi)
movl %eax, 0x7c(%rdi)
movss 0xb397(%rip), %xmm0     # 0x121b0
movups %xmm0, 0x80(%rdi)
movq $0x0, 0x90(%rdi)
movaps 0xb32e(%rip), %xmm0     # 0x12160
movups %xmm0, 0x5c(%rdi)
movl $0x1, 0x98(%rdi)
incl 0x2c(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcComT3_ReadLoop(CapsFdc*)
void FdcComT3_ReadLoop(PCAPSFDC pc)
{
	// update data access
	FdcUpdateData(pc);

	// get access hook, crc
	FDCREAD ph=FdcGetReadAccess(pc);

	// clock cycles to complete
	UDWORD cst=pc->clockact;

	// process requested cycles
	while (!pc->endrequest && pc->clockact<pc->clockreq) {
		// read byte when ready
		if (!ph(pc))
			continue;

		// dsr to data, drq signal
		pc->r_data=pc->dsr;
		FdcSetLine(pc, pc->lineout|CAPSFDC_LO_DRQSET);
	}

	// run cycles on unselected drives
	FdcComIdleOther(pc, pc->clockact-cst);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x792a
movl 0xc(%rbx), %ebp
cmpl $0x0, 0x8(%rbx)
movl %ebp, %esi
jne 0x6e9c
movslq 0x84(%rbx), %rax
leaq 0x11b97(%rip), %rcx     # 0x18a00
movq (%rcx,%rax,8), %r14
movl 0xc(%rbx), %esi
cmpl 0x10(%rbx), %esi
jae 0x6e9c
movq %rbx, %rdi
callq *%r14
testl %eax, %eax
je 0x6e93
movl 0x24(%rbx), %esi
movl 0x78(%rbx), %eax
movl %eax, 0x48(%rbx)
orl $0x40, %esi
movq %rbx, %rdi
callq 0x7624
cmpl $0x0, 0x8(%rbx)
je 0x6e6d
movl 0xc(%rbx), %esi
subl %ebp, %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x7a30
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcComT3_WriteStart(CapsFdc*)
void FdcComT3_WriteStart(PCAPSFDC pc)
{
	// reset logic
	FdcResetData(pc);

	// abort on next index
	pc->indexlimit=1;

	// set loop
	pc->runstate++;
}

// Assembly:
xorl %eax, %eax
movl %eax, 0x50(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x6c(%rdi)
movl %eax, 0x7c(%rdi)
movaps 0xb271(%rip), %xmm0     # 0x12140
movups %xmm0, 0x5c(%rdi)
movss 0xb2d5(%rip), %xmm0     # 0x121b0
movups %xmm0, 0x80(%rdi)
movq $0x0, 0x90(%rdi)
movl $0x1, 0x98(%rdi)
incl 0x2c(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcComT3_AddressLoop(CapsFdc*)
void FdcComT3_AddressLoop(PCAPSFDC pc)
{
	// update data access
	FdcUpdateData(pc);

	// get access hook, crc
	FDCREAD ph=FdcGetReadAccess(pc);

	// clock cycles to complete
	UDWORD cst=pc->clockact;

	// process requested cycles
	while (!pc->endrequest && pc->clockact<pc->clockreq) {
		// read byte when ready
		if (!ph(pc))
			continue;

		// check ID
		switch (pc->dataphase) {
			// detect a1 sync
			case 0:
				// AM detected, read returns on dsr ready
				pc->amisigmask=CAPSFDC_AI_DSRREADY;
				pc->dataphase++;
				break;

			case 1:
				//if not fc...ff, restart
				if (pc->dsr < 0xfc) {
					FdcResetAm(pc);
					continue;
				}

				pc->dataphase++;
				break;

			case 2:
				// set the sector register to the track number
				pc->r_sector=pc->dsr;

			case 3:
			case 4:
			case 5:
			case 6:
			case 7:
				// dsr to data, drq signal
				pc->r_data=pc->dsr;
				FdcSetLine(pc, pc->lineout|CAPSFDC_LO_DRQSET);

				// next phase
				if (pc->dataphase++ == 7) {
					// if crc error, set crc flag
					if (pc->crc & 0xffff)
						pc->r_st0|=CAPSFDC_SR_CRCERR;

					// run cycles used on unselected drives
					FdcComIdleOther(pc, pc->clockact-cst);

					// end
					pc->endrequest|=CAPSFDC_ER_COMEND;
					return;
				}
				break;

			default:
				NODEFAULT;
		}
	}

	// end requested, set seek error
	if (pc->endrequest & CAPSFDC_ER_COMEND)
		pc->r_st0|=CAPSFDC_SR_RNF;

	// run cycles on unselected drives
	FdcComIdleOther(pc, pc->clockact-cst);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x792a
movl 0x8(%rbx), %eax
movl 0xc(%rbx), %ebp
testl %eax, %eax
je 0x6f38
testb $0x1, %al
je 0x6f21
orb $0x10, 0x30(%rbx)
movl 0xc(%rbx), %esi
subl %ebp, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7a30
movslq 0x84(%rbx), %rax
leaq 0x11aba(%rip), %rcx     # 0x18a00
movq (%rcx,%rax,8), %r14
leaq 0xb187(%rip), %r15      # 0x120d8
movl 0xc(%rbx), %eax
cmpl 0x10(%rbx), %eax
jae 0x6f21
movq %rbx, %rdi
callq *%r14
testl %eax, %eax
je 0x6f9a
movl 0x8c(%rbx), %eax
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movl 0x24(%rbx), %esi
movl 0x78(%rbx), %eax
movl %eax, 0x48(%rbx)
orl $0x40, %esi
movq %rbx, %rdi
callq 0x7624
movl 0x8c(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x8c(%rbx)
cmpl $0x7, %eax
je 0x6ff6
movl 0x8(%rbx), %eax
testl %eax, %eax
je 0x6f51
jmp 0x6f19
movl $0x100, 0x64(%rbx)      # imm = 0x100
movl $0x1, 0x8c(%rbx)
jmp 0x6f9a
cmpl $0xfb, 0x78(%rbx)
ja 0x6fea
movl 0x60(%rbx), %eax
andl $-0x10, %eax
orl $0x3, %eax
movl %eax, 0x60(%rbx)
movl $0x200, 0x64(%rbx)      # imm = 0x200
movq $0x0, 0x8c(%rbx)
jmp 0x6f9a
movl 0x78(%rbx), %eax
movl %eax, 0x44(%rbx)
jmp 0x6f72
movl $0x2, 0x8c(%rbx)
jmp 0x6f9a
cmpw $0x0, 0x54(%rbx)
je 0x7001
orb $0x8, 0x30(%rbx)
movl 0xc(%rbx), %esi
subl %ebp, %esi
movq %rbx, %rdi
callq 0x7a30
orb $0x1, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcSetTiming(CapsFdc*)
void FdcSetTiming(PCAPSFDC pc)
{
	// drive specific values
	for (int drv=0; drv < pc->drivecnt; drv++) {
		PCAPSDRIVE pd=pc->drive+drv;

		// clock cycles per revolution
		pd->clockrev=UDWORD(((UQUAD)pc->clockfrq*60)/pd->rpm);

		// clock cycles for index pulse hold
		pd->clockip=UDWORD(((UQUAD)pc->clockfrq*pc->iptime)/1000000);
	}

	// clock cycles for stepping rates
	for (int drv=0; drv < 4; drv++)
		pc->clockstep[drv]=UDWORD(((UQUAD)pc->clockfrq*pc->steptime[drv])/1000000);

	// clock cycles for head settling
	pc->clockhs=UDWORD(((UQUAD)pc->clockfrq*pc->hstime)/1000000);

	// clock cycles for short operations (some SR updates)
	pc->clockupdate=UDWORD(((UQUAD)pc->clockfrq*pc->updatetime)/1000000);
}

// Assembly:
movslq 0xec(%rdi), %r11
movabsq $0x431bde82d7b634db, %r8 # imm = 0x431BDE82D7B634DB
testq %r11, %r11
jle 0x7258
pushq %r14
pushq %rbx
movq 0x108(%rdi), %r10
movl 0x14(%rdi), %r9d
movl 0xe0(%rdi), %eax
imulq $0x3c, %r9, %rcx
imulq %r9, %rax
mulq %r8
movq %rdx, %rsi
shrq $0x12, %rsi
imulq $0x78, %r11, %r11
xorl %ebx, %ebx
movl 0x4(%r10,%rbx), %r14d
movq %rcx, %rax
xorl %edx, %edx
divq %r14
movl %eax, 0x28(%r10,%rbx)
movl %esi, 0x2c(%r10,%rbx)
addq $0x78, %rbx
cmpq %rbx, %r11
jne 0x7233
popq %rbx
popq %r14
jmp 0x725c
movl 0x14(%rdi), %r9d
movq $-0x4, %rcx
movl 0xc8(%rdi,%rcx,4), %eax
imulq %r9, %rax
mulq %r8
shrq $0x12, %rdx
movl %edx, 0xd8(%rdi,%rcx,4)
incq %rcx
jne 0x7263
movl 0xd8(%rdi), %eax
movl 0xe4(%rdi), %ecx
imulq %r9, %rax
mulq %r8
movq %rdx, %rsi
shrq $0x12, %rsi
imulq %r9, %rcx
movq %rcx, %rax
mulq %r8
movl %esi, 0xdc(%rdi)
shrq $0x12, %rdx
movl %edx, 0xe8(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcInit(CapsFdc*)
void FdcInit(PCAPSFDC pc)
{
	// reset drives, no disk inserted
	for (int drv=0; drv < pc->drivecnt; drv++) {
		PCAPSDRIVE pd=pc->drive+drv;
		pd->track=0;
		pd->buftrack=-1;
		pd->side=0;
		pd->bufside=-1;
		pd->newside=0;
		pd->diskattr=CAPSDRIVE_DA_WP;
		pd->idistance=0;
		pd->ipcnt=0;
		pd->ovlact=0;
		pd->nact=0;
		pd->nseed=0x87654321;

		// no track data
		FdcClearTrackData(pd);
	}

	// reset internal state
	FdcResetState(pc);

	// all output lines are clear, without callbacks from init
	pc->dataline=0;
	pc->lineout=0;

	// forced update
	pc->drivesel=pc->drivenew-1;
	FdcUpdateDrive(pc, 0);
}

// Assembly:
cmpl $0x0, 0xec(%rdi)
jle 0x7333
movl $0x5c, %eax
xorl %ecx, %ecx
movaps 0xaeb3(%rip), %xmm0     # 0x12180
movabsq $0x200000000, %rdx      # imm = 0x200000000
xorps %xmm1, %xmm1
movaps 0xaeaf(%rip), %xmm2     # 0x12190
movaps 0xaeb8(%rip), %xmm3     # 0x121a0
xorl %esi, %esi
movq 0x108(%rdi), %r8
movups %xmm0, -0x50(%r8,%rax)
movq %rdx, -0x40(%r8,%rax)
movl %ecx, -0x38(%r8,%rax)
movl %ecx, -0x2c(%r8,%rax)
movups %xmm1, -0x28(%r8,%rax)
movq $0x0, -0x18(%r8,%rax)
movups %xmm2, -0x10(%r8,%rax)
movups %xmm3, (%r8,%rax)
incq %rsi
movslq 0xec(%rdi), %r8
addq $0x78, %rax
cmpq %r8, %rsi
jl 0x72ea
xorps %xmm0, %xmm0
movups %xmm0, 0x3c(%rdi)
movups %xmm0, 0x30(%rdi)
xorl %eax, %eax
movl %eax, 0x2c(%rdi)
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
movq %rcx, 0x94(%rdi)
movl %eax, 0xa4(%rdi)
movl %eax, 0xac(%rdi)
movl %eax, 0xb4(%rdi)
movl %eax, 0x1c(%rdi)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x24(%rdi)
movl 0xf4(%rdi), %eax
decl %eax
movl %eax, 0xf8(%rdi)
xorl %esi, %esi
jmp 0x74ad
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: CAPSFdcEmulate(CapsFdc*, unsigned int)
void __cdecl CAPSFdcEmulate(PCAPSFDC pc, UDWORD cyclecnt)
{
	// no cycles done
	pc->clockact=0;

	// requested cycles
	pc->clockreq=cyclecnt;

	// no end request
	pc->endrequest=0;

	// run fdc for selected clock cycles
	if (pc->clockreq) {
		FDCCALL *fc=fdccall[pc->runmode];

		// process requested cycles
		while (!pc->endrequest && pc->clockact<pc->clockreq)
			fc[pc->runstate](pc);

		// stop processing after end request
		if (pc->endrequest)
			FdcComEnd(pc);
	}

	// update only if all cycles are complete
	if (pc->clockact >= pc->clockreq)
		FdcUpdateDrive(pc, pc->clockreq);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, 0x10(%rdi)
movq $0x0, 0x8(%rdi)
testl %esi, %esi
je 0x7455
movl 0x28(%rbx), %eax
leaq 0x12183(%rip), %rcx     # 0x195a0
movq (%rcx,%rax,8), %r14
movl 0xc(%rbx), %eax
movl 0x10(%rbx), %esi
cmpl %esi, %eax
jae 0x7449
movl 0x2c(%rbx), %eax
movq %rbx, %rdi
callq *(%r14,%rax,8)
cmpl $0x0, 0x8(%rbx)
je 0x7421
movq %rbx, %rdi
callq 0x7466
movl 0xc(%rbx), %eax
movl 0x10(%rbx), %esi
cmpl %esi, %eax
jae 0x7457
addq $0x8, %rsp
popq %rbx
popq %r14
retq
xorl %esi, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x74ad
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcSetLine(CapsFdc*, unsigned int)
void FdcSetLine(PCAPSFDC pc, UDWORD lineout)
{
	// forced interrupt keeps intrq set
	if (lineout & CAPSFDC_LO_INTFRC)
		lineout|=CAPSFDC_LO_INTRQ;

	// get old line state
	UDWORD oldline=pc->lineout;

	// check for drq set
	if (lineout & CAPSFDC_LO_DRQSET) {
		lineout&=~CAPSFDC_LO_DRQSET;
		lineout|=CAPSFDC_LO_DRQ;

		// data lost, if trying to set drq and drq is already set
		if (oldline & CAPSFDC_LO_DRQ)
			pc->r_st1|=CAPSFDC_SR_TR0_LD;
	}

	// changed bits are 1
	UDWORD chgmask=oldline ^ lineout;

	// set new line state
	pc->lineout=lineout;

	// drq change
	if (chgmask & CAPSFDC_LO_DRQ) {
		UDWORD setting=lineout & CAPSFDC_LO_DRQ;
		if (setting)
			pc->r_st1|=CAPSFDC_SR_IP_DRQ;
		else
			pc->r_st1&=~CAPSFDC_SR_IP_DRQ;
		pc->cbdrq(pc, setting);
	}

	// irq change
	if (chgmask & CAPSFDC_LO_INTRQ)
		pc->cbirq(pc, lineout & CAPSFDC_LO_INTRQ);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl %esi, %ebp
shrl %ebp
andl $0x2, %ebp
orl %esi, %ebp
movl 0x24(%rdi), %r14d
testb $0x40, %sil
je 0x764d
andl $-0x42, %ebp
incl %ebp
testb $0x1, %r14b
je 0x764d
orb $0x4, 0x34(%rbx)
xorl %ebp, %r14d
movl %ebp, 0x24(%rbx)
testb $0x1, %r14b
je 0x7673
movl %ebp, %esi
andl $0x1, %esi
movl 0x34(%rbx), %eax
andl $-0x3, %eax
leal (%rax,%rsi,2), %eax
movl %eax, 0x34(%rbx)
movq %rbx, %rdi
callq *0x118(%rbx)
testb $0x2, %r14b
jne 0x767e
popq %rbx
popq %r14
popq %rbp
retq
movq 0x110(%rbx), %rax
andl $0x2, %ebp
movq %rbx, %rdi
movl %ebp, %esi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: CAPSFdcInvalidateTrack(CapsFdc*, int)
SDWORD __cdecl CAPSFdcInvalidateTrack(PCAPSFDC pc, SDWORD drive)
{
	if (!pc)
		return imgeGeneric;

	if (drive<0 || drive>=pc->drivecnt)
		return imgeOutOfRange;

	PCAPSDRIVE pd=pc->drive+drive;
	pd->buftrack=-1;
	pd->bufside=-1;

	return imgeOk;
}

// Assembly:
testq %rdi, %rdi
je 0x778e
movl $0x3, %eax
testl %esi, %esi
js 0x7793
cmpl %esi, 0xec(%rdi)
jle 0x7793
movq 0x108(%rdi), %rax
movl %esi, %ecx
imulq $0x78, %rcx, %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, 0x10(%rax,%rcx)
movl %edx, 0x18(%rax,%rcx)
xorl %eax, %eax
retq
movl $0x2, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcComIdle(CapsFdc*, unsigned int)
UDWORD FdcComIdle(PCAPSFDC pc, UDWORD cyc)
{
	// wait state cancelled if end requested
	if (pc->endrequest & CAPSFDC_ER_REQEND)
		return 0;

	// process all drives
	for (int drv=0; drv < pc->drivemax; drv++) {
		// get drive
		PCAPSDRIVE pd=pc->drive+drv;

		// if motor off no distance change and no index signals to count
		if (!(pd->diskattr & CAPSDRIVE_DA_MO))
			continue;

		// motor on, advance distance
		UDWORD dist=pd->idistance+cyc;

		// restart distance count on new revolution
		if (dist >= pd->clockrev) {
			dist-=pd->clockrev;

			// process disk index
			pd->idistance=0;
			FdcIndex(pc, drv);
		}

		// set distance
		pd->idistance=dist;
	}

	// !!!
	pc->clockact+=cyc;
	return cyc;
}

// Assembly:
xorl %eax, %eax
testb $0x2, 0x8(%rdi)
jne 0x78f4
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl 0xf0(%rdi), %eax
testl %eax, %eax
jle 0x78e0
movl $0x28, %r12d
xorl %r15d, %r15d
movq 0x108(%r14), %r13
testb $0x4, -0x8(%r13,%r12)
je 0x78d1
movl -0x4(%r13,%r12), %ecx
addl %ebx, %ecx
movl %ecx, %ebp
subl (%r13,%r12), %ebp
jb 0x78cc
movl $0x0, -0x4(%r13,%r12)
movq %r14, %rdi
movl %r15d, %esi
callq 0x7ac2
movl 0xf0(%r14), %eax
movl %ebp, %ecx
movl %ecx, -0x4(%r13,%r12)
incq %r15
movslq %eax, %rcx
addq $0x78, %r12
cmpq %rcx, %r15
jl 0x7890
addl %ebx, 0xc(%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcResetAm(CapsFdc*, int)
void FdcResetAm(PCAPSFDC pc, int keepphase)
{
	pc->aminfo|=CAPSFDC_AI_AMDETENABLE|CAPSFDC_AI_CRCENABLE;
	pc->aminfo&=~(CAPSFDC_AI_CRCACTIVE|CAPSFDC_AI_AMACTIVE);
	pc->amisigmask=CAPSFDC_AI_DSRAM;
	if (!keepphase) {
		pc->dataphase=0;
		pc->datapcnt=0;
	}
}

// Assembly:
movl 0x60(%rdi), %eax
andl $-0x10, %eax
orl $0x3, %eax
movl %eax, 0x60(%rdi)
movl $0x200, 0x64(%rdi)      # imm = 0x200
testl %esi, %esi
je 0x7a24
retq
movq $0x0, 0x8c(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsFDCEmulator.cpp
// Function: FdcComIdleOther(CapsFdc*, unsigned int)
void FdcComIdleOther(PCAPSFDC pc, UDWORD cyc)
{
	// process all drives
	for (int drv=0; drv < pc->drivemax; drv++) {
		// skip active drive
		if (drv == pc->driveact)
			continue;

		// get drive
		PCAPSDRIVE pd=pc->drive+drv;

		// if motor off no distance change
		if (!(pd->diskattr & CAPSDRIVE_DA_MO))
			continue;

		// motor on, advance distance
		UDWORD dist=pd->idistance+cyc;

		// restart distance count on new revolution
		if (dist >= pd->clockrev) {
			dist-=pd->clockrev;

			// process disk index
			pd->idistance=0;
			FdcIndex(pc, drv);
		}

		// set distance
		pd->idistance=dist;
	}
}

// Assembly:
movl 0xf0(%rdi), %eax
testl %eax, %eax
jle 0x7ac1
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl $0x28, %r12d
xorl %r15d, %r15d
movl 0xfc(%r14), %ecx
cmpq %rcx, %r15
je 0x7aa4
movq 0x108(%r14), %r13
testb $0x4, -0x8(%r13,%r12)
je 0x7aa4
movl -0x4(%r13,%r12), %ecx
addl %ebx, %ecx
movl %ecx, %ebp
subl (%r13,%r12), %ebp
jb 0x7a9f
movl $0x0, -0x4(%r13,%r12)
movq %r14, %rdi
movl %r15d, %esi
callq 0x7ac2
movl 0xf0(%r14), %eax
movl %ebp, %ecx
movl %ecx, -0x4(%r13,%r12)
incq %r15
movslq %eax, %rcx
addq $0x78, %r12
cmpq %rcx, %r15
jl 0x7a57
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq