LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsImageStd.cpp
// Function: CCapsImageStd::SetLoop(ImageStreamInfo*, int)
void CCapsImageStd::SetLoop(PIMAGESTREAMINFO pg, int value)
{
	switch (pg->looptype) {
		// no loop point, disable sample size change
		case isiltNone:
			pg->scenable=0;
			break;

		// disable/enable size change at the loop point
		case isiltAuto:
			if (value) {
				pg->scenable=1;
				pg->scofs=pg->loopofs;
				pg->scmul=value;
			} else
				pg->scenable=0;
			break;

		// change loop point to fixed size sample
		case isiltStream:
			pg->scenable=1;
			pg->scofs=pg->loopofs;
			pg->scmul=value;
			break;
	}

	// update loop, just in case the current first sample is the loop point
	GetLoop(pg);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x8c(%rax), %eax
movl %eax, -0x18(%rbp)
testl %eax, %eax
je 0x13735
jmp 0x1371e
movl -0x18(%rbp), %eax
subl $0x1, %eax
je 0x13745
jmp 0x13728
movl -0x18(%rbp), %eax
subl $0x2, %eax
je 0x1378c
jmp 0x137bb
movq -0x10(%rbp), %rax
movl $0x0, 0x98(%rax)
jmp 0x137bb
cmpl $0x0, -0x14(%rbp)
je 0x1377c
movq -0x10(%rbp), %rax
movl $0x1, 0x98(%rax)
movq -0x10(%rbp), %rax
movl 0x84(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x9c(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xa0(%rax)
jmp 0x1378a
movq -0x10(%rbp), %rax
movl $0x0, 0x98(%rax)
jmp 0x137bb
movq -0x10(%rbp), %rax
movl $0x1, 0x98(%rax)
movq -0x10(%rbp), %rax
movl 0x84(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x9c(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xa0(%rax)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x121e0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsLoader.cpp
// Function: CCapsLoader::Unlock()
void CCapsLoader::Unlock()
{
	file.Close();
	flen=0;
	chunk.type=ccidUnknown;
	readmode=true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
addq $0x10, %rdi
callq 0xc4b0
movq -0x10(%rbp), %rax
movl $0x0, 0x20(%rax)
movl $0x7, 0x84(%rax)
movl $0x1, 0x8(%rax)
addq $0x10, %rsp
popq %rbp
retq
nop
// File: OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsLoader.cpp
// Function: CCapsLoader::Lock(CapsFile*)
int CCapsLoader::Lock(PCAPSFILE pcf)
{
	// close previous file
	Unlock();

	// open file
	if (file.Open(pcf)) {
		Unlock();
		return ccidErrFile;
	}

	// set read mode
	readmode=(pcf->flag & CFF_WRITE) ? false : true;

	// get file size, no file skip
	flen=file.GetSize();

	// check for caps id
	if (ReadChunk(true) != ccidFile) {
		Unlock();
		return ccidErrType;
	}

	return ccidCaps;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x20(%rbp)
callq 0x15220
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movq -0x18(%rbp), %rsi
callq 0xc550
cmpl $0x0, %eax
je 0x15315
movq -0x20(%rbp), %rdi
callq 0x15220
movl $0x1, -0x4(%rbp)
jmp 0x1536d
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
andl $0x1, %eax
movl %eax, %ecx
xorl %eax, %eax
subq $0x1, %rcx
sbbl %eax, %eax
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x8(%rdi)
addq $0x10, %rdi
callq 0xc7b0
movq -0x20(%rbp), %rdi
movl %eax, 0x20(%rdi)
movl $0x1, %esi
callq 0x15380
cmpl $0x8, %eax
je 0x15366
movq -0x20(%rbp), %rdi
callq 0x15220
movl $0x2, -0x4(%rbp)
jmp 0x1536d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsLoader.cpp
// Function: CCapsLoader::SkipData()
int CCapsLoader::SkipData()
{
	// handle file error
	if (!file.IsOpen())
		return 0;

	// do not skip next time, clear type
	int type=chunk.type;
	chunk.type=ccidUnknown;

	// skip only data area
	if (type != ccidData)
		return 0;

	// do not skip empty area
	int skip=chunk.cg.mod.data.size;
	if (!skip)
		return 0;

	// correct skip size if image is short
	int pos=file.GetPosition();
	if (flen-pos < skip)
		skip=flen-pos;

	// seek to new chunk
	file.Seek(skip, 0);
	return skip;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x28(%rbp)
addq $0x10, %rdi
callq 0xc790
cmpl $0x0, %eax
jne 0x155ee
movl $0x0, -0x4(%rbp)
jmp 0x15676
movq -0x28(%rbp), %rax
movl 0x84(%rax), %ecx
movl %ecx, -0x14(%rbp)
movl $0x7, 0x84(%rax)
cmpl $0xa, -0x14(%rbp)
je 0x15614
movl $0x0, -0x4(%rbp)
jmp 0x15676
movq -0x28(%rbp), %rax
movl 0x94(%rax), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x15630
movl $0x0, -0x4(%rbp)
jmp 0x15676
movq -0x28(%rbp), %rdi
addq $0x10, %rdi
callq 0xc7d0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, -0x1c(%rbp)
movl 0x20(%rax), %eax
subl -0x1c(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x1565e
movq -0x28(%rbp), %rax
movl 0x20(%rax), %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x28(%rbp), %rdi
addq $0x10, %rdi
movl -0x18(%rbp), %esi
xorl %edx, %edx
callq 0xc740
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsLoader.cpp
// Function: CCapsLoader::GetChunkType(CapsChunk*)
int CCapsLoader::GetChunkType(PCAPSCHUNK pc)
{
	int pos;

	for (pos=0; chunklist[pos].name; pos++)
		if (!memcmp(chunklist[pos].name, pc->cg.file.name, sizeof(pc->cg.file.name)))
			break;

	return pc->type=chunklist[pos].type;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0x11f96(%rip), %rax     # 0x27630
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x156e4
movslq -0xc(%rbp), %rcx
leaq 0x11f7e(%rip), %rax     # 0x27630
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
addq $0x4, %rcx
movl (%rcx), %ecx
movl (%rax), %eax
subl %ecx, %eax
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x156d7
jmp 0x156e4
jmp 0x156d9
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1568f
movslq -0xc(%rbp), %rcx
leaq 0x11f41(%rip), %rax     # 0x27630
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x8(%rbp), %rcx
movl %eax, (%rcx)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsLoader.cpp
// Function: CCapsLoader::Swap(unsigned int*, int)
void CCapsLoader::Swap(PUDWORD buf, int cnt)
{
#ifdef INTEL
	for (cnt>>=2; cnt > 0; cnt--, buf++) {
		UDWORD src=*buf;
		UDWORD dst=_lrotl(src, 8)&0x00ff00ff | _lrotr(src, 8)&0xff00ff00;
		*buf=dst;
	}
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
sarl $0x2, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jle 0x1577f
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
shll $0x8, %eax
movl -0x10(%rbp), %ecx
shrl $0x18, %ecx
orl %ecx, %eax
andl $0xff00ff, %eax         # imm = 0xFF00FF
movl -0x10(%rbp), %ecx
shrl $0x8, %ecx
movl -0x10(%rbp), %edx
shll $0x18, %edx
orl %edx, %ecx
andl $0xff00ff00, %ecx       # imm = 0xFF00FF00
orl %ecx, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x8(%rbp)
jmp 0x15724
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsLoader.cpp
// Function: CCapsLoader::ReadData(unsigned char*)
int CCapsLoader::ReadData(PUBYTE buf)
{
	// handle file error
	if (!file.IsOpen())
		return 0;

	// do not read next time, clear type
	int type=chunk.type;
	chunk.type=ccidUnknown;

	// skip only data area
	if (type != ccidData)
		return 0;

	// do not skip empty area
	int size=chunk.cg.mod.data.size;
	if (!size)
		return 0;

	// correct and skip size if image is short
	int pos=file.GetPosition();
	if (flen-pos < size) {
		size=flen-pos;

		// seek to new chunk
		file.Seek(size, 0);
		return 0;
	}

	// read data area
	if (file.Read(buf, size) != size)
		return 0;

	// check data CRC if available
	if (chunk.cg.mod.data.dcrc)
		if (chunk.cg.mod.data.dcrc != CalcCRC(buf, size))
			return 0;

	return size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x30(%rbp)
addq $0x10, %rdi
callq 0xc790
cmpl $0x0, %eax
jne 0x157c2
movl $0x0, -0x4(%rbp)
jmp 0x158b1
movq -0x30(%rbp), %rax
movl 0x84(%rax), %ecx
movl %ecx, -0x1c(%rbp)
movl $0x7, 0x84(%rax)
cmpl $0xa, -0x1c(%rbp)
je 0x157eb
movl $0x0, -0x4(%rbp)
jmp 0x158b1
movq -0x30(%rbp), %rax
movl 0x94(%rax), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x1580a
movl $0x0, -0x4(%rbp)
jmp 0x158b1
movq -0x30(%rbp), %rdi
addq $0x10, %rdi
callq 0xc7d0
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, -0x24(%rbp)
movl 0x20(%rax), %eax
subl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x1584f
movq -0x30(%rbp), %rdi
movl 0x20(%rdi), %eax
subl -0x24(%rbp), %eax
movl %eax, -0x20(%rbp)
addq $0x10, %rdi
movl -0x20(%rbp), %esi
xorl %edx, %edx
callq 0xc740
movl $0x0, -0x4(%rbp)
jmp 0x158b1
movq -0x30(%rbp), %rdi
addq $0x10, %rdi
movq -0x18(%rbp), %rsi
movl -0x20(%rbp), %edx
callq 0xc6e0
cmpl -0x20(%rbp), %eax
je 0x15871
movl $0x0, -0x4(%rbp)
jmp 0x158b1
movq -0x30(%rbp), %rax
cmpl $0x0, 0x9c(%rax)
je 0x158ab
movq -0x30(%rbp), %rax
movl 0x9c(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x5890
movl %eax, %ecx
movl -0x34(%rbp), %eax
cmpl %ecx, %eax
je 0x158a9
movl $0x0, -0x4(%rbp)
jmp 0x158b1
jmp 0x158ab
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsLoader.cpp
// Function: CCapsLoader::GetDataSize()
int CCapsLoader::GetDataSize()
{
	// handle file error
	if (!file.IsOpen())
		return 0;

	// skip only data area
	if (chunk.type != ccidData)
		return 0;

	// size in bytes
	return chunk.cg.mod.data.size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x18(%rbp)
addq $0x10, %rdi
callq 0xc790
cmpl $0x0, %eax
jne 0x158eb
movl $0x0, -0x4(%rbp)
jmp 0x1590e
movq -0x18(%rbp), %rax
cmpl $0xa, 0x84(%rax)
je 0x15901
movl $0x0, -0x4(%rbp)
jmp 0x1590e
movq -0x18(%rbp), %rax
movl 0x94(%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsLoader.cpp
// Function: CCapsLoader::SetPosition(int)
int CCapsLoader::SetPosition(int pos)
{
	// handle file error
	if (!file.IsOpen())
		return 0;

	// chunk type unknown after seek
	chunk.type=ccidUnknown;

	// keep file boundaries
	if (pos < 0)
		pos=0;
	else
		if (flen < pos)
			pos=flen;

	// seek
	file.Seek(pos, -1);

	return pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0x10, %rdi
callq 0xc790
cmpl $0x0, %eax
jne 0x1599e
movl $0x0, -0x4(%rbp)
jmp 0x159ee
movq -0x20(%rbp), %rax
movl $0x7, 0x84(%rax)
cmpl $0x0, -0x14(%rbp)
jge 0x159bb
movl $0x0, -0x14(%rbp)
jmp 0x159d3
movq -0x20(%rbp), %rax
movl 0x20(%rax), %eax
cmpl -0x14(%rbp), %eax
jge 0x159d1
movq -0x20(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x159d3
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movl -0x14(%rbp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xc740
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/CapsLoader.cpp
// Function: CCapsLoader::ConvertChunk(CapsChunk*)
void CCapsLoader::ConvertChunk(PCAPSCHUNK pc)
{
	if (!pc)
		return;

	// set complete chunk to network byte order
	int ofs=sizeof(pc->cg.file.name);
	int size=pc->cg.file.size;
	Swap(PUDWORD((PUBYTE)&pc->cg.file+ofs), size-ofs);

	// calculate crc and set to network byte order
	pc->cg.file.hcrc=0;
	pc->cg.file.hcrc=CalcCRC((PUBYTE)&pc->cg.file, size);
	CCapsLoader::Swap(&pc->cg.file.hcrc, sizeof(pc->cg.file.hcrc));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x15a15
jmp 0x15a7a
movl $0x4, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
movslq -0xc(%rbp), %rax
addq %rax, %rdi
movl -0x10(%rbp), %esi
subl -0xc(%rbp), %esi
callq 0x15710
movq -0x8(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
movl -0x10(%rbp), %esi
callq 0x5890
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
addq $0x8, %rdi
movl $0x4, %esi
callq 0x15710
addq $0x10, %rsp
popq %rbp
retq
// File: OpenFodder[P]SOS_Unpacker/capsimg/Codec/DiskEncoding.cpp
// Function: CDiskEncoding::InitFM()
void CDiskEncoding::InitFM()
{
	// stop if correct tables are available
	if (fminit)
		return;

	// create tables
	if (!fmcode)
		fmcode=new uint32_t[256];

	if (!fmdecode)
		fmdecode=new uint32_t[65536];

	uint32_t sval;

	// create FM word code table
	for (sval=0x0000; sval < 256; sval++) {
		uint32_t code=0;

		// generate clock and data bits
		for (uint32_t bit=0x80; bit; bit>>=1) {
			code<<=2;

			// always set clock to 1, and add data
			code|=(sval & bit) ? 3 : 2;
		}

		// store encoding
		fmcode[sval]=code;
	}

	// create FM decode table
	for (sval=0x0000; sval < 0x10000; sval++) {
		uint32_t code=0;

		// all bits
		for (uint32_t bit=0x4000; bit; bit>>=2) {
			code<<=1;
			if (sval & bit)
				code|=1;
		}

		// store decoding, mark coding erros
		uint32_t cd=fmcode[code] & 0xffff;
		if (cd != sval)
			code|=DF_31;
		fmdecode[sval]=code;
	}

	fminit=1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
cmpl $0x0, 0x1368d(%rip)     # 0x2959c
je 0x15f16
jmp 0x16063
cmpq $0x0, 0x13682(%rip)     # 0x295a0
jne 0x15f31
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, 0x1366f(%rip)     # 0x295a0
cmpq $0x0, 0x1366f(%rip)     # 0x295a8
jne 0x15f4c
movl $0x40000, %edi          # imm = 0x40000
callq 0x4040
movq %rax, 0x1365c(%rip)     # 0x295a8
movl $0x0, -0x4(%rbp)
cmpl $0x100, -0x4(%rbp)      # imm = 0x100
jae 0x15fba
movl $0x0, -0x8(%rbp)
movl $0x80, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x15f9f
movl -0x8(%rbp), %eax
shll $0x2, %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %edx
andl -0xc(%rbp), %edx
movl $0x2, %eax
movl $0x3, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
orl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0xc(%rbp), %eax
shrl %eax
movl %eax, -0xc(%rbp)
jmp 0x15f6a
movl -0x8(%rbp), %edx
movq 0x135f7(%rip), %rax     # 0x295a0
movl -0x4(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x15f53
movl $0x0, -0x4(%rbp)
cmpl $0x10000, -0x4(%rbp)    # imm = 0x10000
jae 0x16059
movl $0x0, -0x10(%rbp)
movl $0x4000, -0x14(%rbp)    # imm = 0x4000
cmpl $0x0, -0x14(%rbp)
je 0x1600b
movl -0x10(%rbp), %eax
shll %eax
movl %eax, -0x10(%rbp)
movl -0x4(%rbp), %eax
andl -0x14(%rbp), %eax
cmpl $0x0, %eax
je 0x15ffe
movl -0x10(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x16000
movl -0x14(%rbp), %eax
shrl $0x2, %eax
movl %eax, -0x14(%rbp)
jmp 0x15fdc
movq 0x1358e(%rip), %rax     # 0x295a0
movl -0x10(%rbp), %ecx
movl (%rax,%rcx,4), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x4(%rbp), %eax
je 0x1603b
movl -0x10(%rbp), %eax
movabsq $0x80000000, %rcx       # imm = 0x80000000
orq %rcx, %rax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edx
movq 0x13563(%rip), %rax     # 0x295a8
movl -0x4(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x15fc1
movl $0x1, 0x13539(%rip)     # 0x2959c
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Codec/DiskEncoding.cpp
// Function: CDiskEncoding::InitGCRCBM(unsigned int*, int)
void CDiskEncoding::InitGCRCBM(uint32_t *gcrtable, int gcrid)
{
	// cancel if table initialized with the same gcr version
	if (gcrid == gcrinit)
		return;

	// create tables
	if (!gcrcode)
		gcrcode=new uint32_t[256];

	if (!gcrdecode)
		gcrdecode=new uint32_t[1024];

	uint32_t sval;

	// set GCR decode table to coding error as default
	for (sval=0; sval < 1024; sval++)
		gcrdecode[sval]=DF_31;

	// create GCR table
	for (sval=0; sval < 256; sval++) {
		uint32_t ghi=gcrtable[sval >> 4];
		uint32_t glo=gcrtable[sval & 0xf];
		uint32_t code=ghi << 5 | glo;
		gcrcode[sval]=code;
		gcrdecode[code]=sval;
	}

	gcrinit=gcrid;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x13290(%rip), %eax     # 0x295c8
jne 0x1633f
jmp 0x16415
cmpq $0x0, 0x13289(%rip)     # 0x295d0
jne 0x1635a
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, 0x13276(%rip)     # 0x295d0
cmpq $0x0, 0x13276(%rip)     # 0x295d8
jne 0x16375
movl $0x1000, %edi           # imm = 0x1000
callq 0x4040
movq %rax, 0x13263(%rip)     # 0x295d8
movl $0x0, -0x10(%rbp)
cmpl $0x400, -0x10(%rbp)     # imm = 0x400
jae 0x163a1
movq 0x1324c(%rip), %rax     # 0x295d8
movl -0x10(%rbp), %ecx
movl $0x80000000, (%rax,%rcx,4) # imm = 0x80000000
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1637c
movl $0x0, -0x10(%rbp)
cmpl $0x100, -0x10(%rbp)     # imm = 0x100
jae 0x1640c
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
andl $0xf, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
shll $0x5, %eax
orl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edx
movq 0x131e5(%rip), %rax     # 0x295d0
movl -0x10(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x10(%rbp), %edx
movq 0x131dd(%rip), %rax     # 0x295d8
movl -0x1c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x163a8
movl -0xc(%rbp), %eax
movl %eax, 0x131b3(%rip)     # 0x295c8
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Codec/DiskEncoding.cpp
// Function: CDiskEncoding::InitGCRCBM_S(unsigned int*, int)
void CDiskEncoding::InitGCRCBM_S(uint32_t *gcrtable, int gcrid)
{
	// cancel if table initialized with the same gcr version
	if (gcrid == gcrinit_s)
		return;

	// create tables
	if (!gcrcode_s)
		gcrcode_s=new uint32_t[256];

	if (!gcrdecode_s)
		gcrdecode_s=new uint32_t[1024];

	uint32_t sval;

	// set GCR decode table to coding error as default
	for (sval=0; sval < 1024; sval++)
		gcrdecode_s[sval]=DF_31;

	// create GCR table
	for (sval=0; sval < 256; sval++) {
		uint32_t ghi=gcrtable[sval >> 4];
		uint32_t glo=gcrtable[sval & 0xf];
		uint32_t code=ghi << 5 | glo;
		gcrcode_s[sval]=code;
		gcrdecode_s[code]=sval;
	}

	gcrinit_s=gcrid;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl 0x131a8(%rip), %eax     # 0x295e0
jne 0x1643f
jmp 0x16515
cmpq $0x0, 0x131a1(%rip)     # 0x295e8
jne 0x1645a
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, 0x1318e(%rip)     # 0x295e8
cmpq $0x0, 0x1318e(%rip)     # 0x295f0
jne 0x16475
movl $0x1000, %edi           # imm = 0x1000
callq 0x4040
movq %rax, 0x1317b(%rip)     # 0x295f0
movl $0x0, -0x10(%rbp)
cmpl $0x400, -0x10(%rbp)     # imm = 0x400
jae 0x164a1
movq 0x13164(%rip), %rax     # 0x295f0
movl -0x10(%rbp), %ecx
movl $0x80000000, (%rax,%rcx,4) # imm = 0x80000000
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x1647c
movl $0x0, -0x10(%rbp)
cmpl $0x100, -0x10(%rbp)     # imm = 0x100
jae 0x1650c
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
andl $0xf, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
shll $0x5, %eax
orl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edx
movq 0x130fd(%rip), %rax     # 0x295e8
movl -0x10(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x10(%rbp), %edx
movq 0x130f5(%rip), %rax     # 0x295f0
movl -0x1c(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x164a8
movl -0xc(%rbp), %eax
movl %eax, 0x130cb(%rip)     # 0x295e0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Codec/DiskEncoding.cpp
// Function: CDiskEncoding::InitGCRAppleH()
void CDiskEncoding::InitGCRAppleH()
{
	// stop if correct tables are available
	if (gcrahinit)
		return;

	// create tables
	if (!gcrahcode)
		gcrahcode=new uint32_t[256];

	if (!gcrahdecode)
		gcrahdecode=new uint32_t[65536];

	uint32_t sval;

	// create code table
	for (sval=0x0000; sval < 256; sval++) {
		// generate clock and data bits, like FM but bits are interleaved
		// C7C5C3C1 C6C4C2C0
		uint32_t ahi=(sval >> 1) | 0xaa;
		uint32_t alo=sval | 0xaa;
		uint32_t code=ahi << 8 | alo;

		// store encoding
		gcrahcode[sval]=code;
	}

	// create decode table
	for (sval=0x0000; sval < 0x10000; sval++) {
		uint32_t dhi=(sval >> 8) & 0x55;
		uint32_t dlo=sval & 0x55;
		uint32_t code=dhi << 1 | dlo;

		// store decoding, mark coding erros
		uint32_t cd=gcrahcode[code] & 0xffff;
		if (cd != sval)
			code|=DF_31;
		gcrahdecode[sval]=code;
	}

	gcrahinit=1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
cmpl $0x0, 0x130c9(%rip)     # 0x295f8
je 0x16536
jmp 0x16640
cmpq $0x0, 0x130c2(%rip)     # 0x29600
jne 0x16551
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, 0x130af(%rip)     # 0x29600
cmpq $0x0, 0x130af(%rip)     # 0x29608
jne 0x1656c
movl $0x40000, %edi          # imm = 0x40000
callq 0x4040
movq %rax, 0x1309c(%rip)     # 0x29608
movl $0x0, -0x4(%rbp)
cmpl $0x100, -0x4(%rbp)      # imm = 0x100
jae 0x165bb
movl -0x4(%rbp), %eax
shrl %eax
orl $0xaa, %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
orl $0xaa, %eax
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %eax
shll $0x8, %eax
orl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edx
movq 0x13056(%rip), %rax     # 0x29600
movl -0x4(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x16573
movl $0x0, -0x4(%rbp)
cmpl $0x10000, -0x4(%rbp)    # imm = 0x10000
jae 0x16636
movl -0x4(%rbp), %eax
shrl $0x8, %eax
andl $0x55, %eax
movl %eax, -0x14(%rbp)
movl -0x4(%rbp), %eax
andl $0x55, %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
shll %eax
orl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq 0x1300e(%rip), %rax     # 0x29600
movl -0x1c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x4(%rbp), %eax
je 0x1661b
movl -0x1c(%rbp), %eax
movabsq $0x80000000, %rcx       # imm = 0x80000000
orq %rcx, %rax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edx
movq 0x12fe3(%rip), %rax     # 0x29608
movl -0x4(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x165c2
movl $0x1, 0x12fb8(%rip)     # 0x295f8
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Codec/DiskEncoding.cpp
// Function: CDiskEncoding::InitGCRApple5(unsigned int*)
void CDiskEncoding::InitGCRApple5(uint32_t *gcrtable)
{
	// stop if correct tables are available
	if (gcra5init)
		return;

	// create tables
	if (!gcra5code)
		gcra5code=new uint32_t[32];

	if (!gcra5decode)
		gcra5decode=new uint32_t[256];

	uint32_t sval;

	// set GCR decode table to coding error as default
	for (sval=0; sval < 256; sval++)
		gcra5decode[sval]=DF_31;

	// create GCR table
	for (sval=0; sval < 32; sval++) {
		uint32_t code=gcrtable[sval];
		gcra5code[sval]=code;
		gcra5decode[code]=sval;
	}

	gcra5init=1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpl $0x0, 0x12fad(%rip)     # 0x29610
je 0x1666a
jmp 0x1671b
cmpq $0x0, 0x12fa6(%rip)     # 0x29618
jne 0x16685
movl $0x80, %edi
callq 0x4040
movq %rax, 0x12f93(%rip)     # 0x29618
cmpq $0x0, 0x12f93(%rip)     # 0x29620
jne 0x166a0
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, 0x12f80(%rip)     # 0x29620
movl $0x0, -0xc(%rbp)
cmpl $0x100, -0xc(%rbp)      # imm = 0x100
jae 0x166cc
movq 0x12f69(%rip), %rax     # 0x29620
movl -0xc(%rbp), %ecx
movl $0x80000000, (%rax,%rcx,4) # imm = 0x80000000
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x166a7
movl $0x0, -0xc(%rbp)
cmpl $0x20, -0xc(%rbp)
jae 0x16711
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edx
movq 0x12f28(%rip), %rax     # 0x29618
movl -0xc(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %edx
movq 0x12f20(%rip), %rax     # 0x29620
movl -0x10(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x166d3
movl $0x1, 0x12ef5(%rip)     # 0x29610
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Codec/DiskEncoding.cpp
// Function: CDiskEncoding::InitGCRApple6(unsigned int*)
void CDiskEncoding::InitGCRApple6(uint32_t *gcrtable)
{
	// stop if correct tables are available
	if (gcra6init)
		return;

	// create tables
	if (!gcra6code)
		gcra6code=new uint32_t[64];

	if (!gcra6decode)
		gcra6decode=new uint32_t[256];

	uint32_t sval;

	// set GCR decode table to coding error as default
	for (sval=0; sval < 256; sval++)
		gcra6decode[sval]=DF_31;

	// create GCR table
	for (sval=0; sval < 64; sval++) {
		uint32_t code=gcrtable[sval];
		gcra6code[sval]=code;
		gcra6decode[code]=sval;
	}

	gcra6init=1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpl $0x0, 0x12ee5(%rip)     # 0x29628
je 0x1674a
jmp 0x167fb
cmpq $0x0, 0x12ede(%rip)     # 0x29630
jne 0x16765
movl $0x100, %edi            # imm = 0x100
callq 0x4040
movq %rax, 0x12ecb(%rip)     # 0x29630
cmpq $0x0, 0x12ecb(%rip)     # 0x29638
jne 0x16780
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, 0x12eb8(%rip)     # 0x29638
movl $0x0, -0xc(%rbp)
cmpl $0x100, -0xc(%rbp)      # imm = 0x100
jae 0x167ac
movq 0x12ea1(%rip), %rax     # 0x29638
movl -0xc(%rbp), %ecx
movl $0x80000000, (%rax,%rcx,4) # imm = 0x80000000
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x16787
movl $0x0, -0xc(%rbp)
cmpl $0x40, -0xc(%rbp)
jae 0x167f1
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edx
movq 0x12e60(%rip), %rax     # 0x29630
movl -0xc(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %edx
movq 0x12e58(%rip), %rax     # 0x29638
movl -0x10(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x167b3
movl $0x1, 0x12e2d(%rip)     # 0x29628
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Codec/DiskEncoding.cpp
// Function: CDiskEncoding::InitGCRVorpal(unsigned int*)
void CDiskEncoding::InitGCRVorpal(uint32_t *gcrtable)
{
	// stop if correct tables are available
	if (gcrvorpalinit)
		return;

	// create tables
	if (!gcrvorpalcode)
		gcrvorpalcode=new uint32_t[64];

	if (!gcrvorpaldecode)
		gcrvorpaldecode=new uint32_t[256];

	uint32_t sval;

	// set GCR decode table to coding error as default
	for (sval=0; sval < 256; sval++)
		gcrvorpaldecode[sval]=DF_31;

	// create GCR table
	for (sval=0; sval < 64; sval++) {
		uint32_t code=gcrtable[sval];
		gcrvorpalcode[sval]=code;
		gcrvorpaldecode[code]=sval;
	}

	gcrvorpalinit=1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpl $0x0, 0x12e1d(%rip)     # 0x29640
je 0x1682a
jmp 0x168db
cmpq $0x0, 0x12e16(%rip)     # 0x29648
jne 0x16845
movl $0x100, %edi            # imm = 0x100
callq 0x4040
movq %rax, 0x12e03(%rip)     # 0x29648
cmpq $0x0, 0x12e03(%rip)     # 0x29650
jne 0x16860
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, 0x12df0(%rip)     # 0x29650
movl $0x0, -0xc(%rbp)
cmpl $0x100, -0xc(%rbp)      # imm = 0x100
jae 0x1688c
movq 0x12dd9(%rip), %rax     # 0x29650
movl -0xc(%rbp), %ecx
movl $0x80000000, (%rax,%rcx,4) # imm = 0x80000000
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x16867
movl $0x0, -0xc(%rbp)
cmpl $0x40, -0xc(%rbp)
jae 0x168d1
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edx
movq 0x12d98(%rip), %rax     # 0x29648
movl -0xc(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %edx
movq 0x12d90(%rip), %rax     # 0x29650
movl -0x10(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x16893
movl $0x1, 0x12d65(%rip)     # 0x29640
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Codec/DiskEncoding.cpp
// Function: CDiskEncoding::InitGCRVMax(unsigned int*, int)
void CDiskEncoding::InitGCRVMax(uint32_t *gcrtable, int vmaxid)
{
	// cancel if table initialized with the same gcr version
	if (gcrvmaxinit == vmaxid)
		return;

	// create tables
	if (!gcrvmaxcode)
		gcrvmaxcode=new uint32_t[64];

	if (!gcrvmaxdecode)
		gcrvmaxdecode=new uint32_t[256];

	uint32_t sval;

	// set GCR decode table to coding error as default
	for (sval=0; sval < 256; sval++)
		gcrvmaxdecode[sval]=DF_31;

	// create GCR table
	for (sval=0; sval < 64; sval++) {
		uint32_t code=gcrtable[sval];
		if (!code)
			continue;

		gcrvmaxcode[sval]=code;
		gcrvmaxdecode[code]=sval;
	}

	gcrvmaxinit=vmaxid;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl 0x12adb(%rip), %eax     # 0x29670
cmpl -0xc(%rbp), %eax
jne 0x16b9f
jmp 0x16c57
cmpq $0x0, 0x12ad1(%rip)     # 0x29678
jne 0x16bba
movl $0x100, %edi            # imm = 0x100
callq 0x4040
movq %rax, 0x12abe(%rip)     # 0x29678
cmpq $0x0, 0x12abe(%rip)     # 0x29680
jne 0x16bd5
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, 0x12aab(%rip)     # 0x29680
movl $0x0, -0x10(%rbp)
cmpl $0x100, -0x10(%rbp)     # imm = 0x100
jae 0x16c01
movq 0x12a94(%rip), %rax     # 0x29680
movl -0x10(%rbp), %ecx
movl $0x80000000, (%rax,%rcx,4) # imm = 0x80000000
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x16bdc
movl $0x0, -0x10(%rbp)
cmpl $0x40, -0x10(%rbp)
jae 0x16c4e
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x16c23
jmp 0x16c43
movl -0x14(%rbp), %edx
movq 0x12a4b(%rip), %rax     # 0x29678
movl -0x10(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x10(%rbp), %edx
movq 0x12a43(%rip), %rax     # 0x29680
movl -0x14(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x16c08
movl -0xc(%rbp), %eax
movl %eax, 0x12a19(%rip)     # 0x29670
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Codec/DiskEncoding.cpp
// Function: CDiskEncoding::InitGCR4Bit(unsigned int*)
void CDiskEncoding::InitGCR4Bit(uint32_t *gcrtable)
{
	// stop if correct tables are available
	if (gcr4bitinit)
		return;

	// create tables
	if (!gcr4bitcode)
		gcr4bitcode=new uint32_t[16];

	if (!gcr4bitdecode)
		gcr4bitdecode=new uint32_t[256];

	uint32_t sval;

	// set GCR decode table to coding error as default
	for (sval=0; sval < 256; sval++)
		gcr4bitdecode[sval]=DF_31;

	// create GCR table
	for (sval=0; sval < 16; sval++) {
		uint32_t code=gcrtable[sval];
		gcr4bitcode[sval]=code;
		gcr4bitdecode[code]=sval;
	}

	gcr4bitinit=1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpl $0x0, 0x12a15(%rip)     # 0x29688
je 0x16c7a
jmp 0x16d2b
cmpq $0x0, 0x12a0e(%rip)     # 0x29690
jne 0x16c95
movl $0x40, %edi
callq 0x4040
movq %rax, 0x129fb(%rip)     # 0x29690
cmpq $0x0, 0x129fb(%rip)     # 0x29698
jne 0x16cb0
movl $0x400, %edi            # imm = 0x400
callq 0x4040
movq %rax, 0x129e8(%rip)     # 0x29698
movl $0x0, -0xc(%rbp)
cmpl $0x100, -0xc(%rbp)      # imm = 0x100
jae 0x16cdc
movq 0x129d1(%rip), %rax     # 0x29698
movl -0xc(%rbp), %ecx
movl $0x80000000, (%rax,%rcx,4) # imm = 0x80000000
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x16cb7
movl $0x0, -0xc(%rbp)
cmpl $0x10, -0xc(%rbp)
jae 0x16d21
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %edx
movq 0x12990(%rip), %rax     # 0x29690
movl -0xc(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %edx
movq 0x12988(%rip), %rax     # 0x29698
movl -0x10(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x16ce3
movl $0x1, 0x1295d(%rip)     # 0x29688
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Core/DiskFile.cpp
// Function: CDiskFile::Open(char const*, unsigned int)
int CDiskFile::Open(const char *name, unsigned int mode)
{
	// close file if it is open
	Close();

	// check name
	if (!name || !strlen(name))
		return 1;

	// select open mode
	const char *om;

	if (mode & BFFLAG_WRITE) {
		if (mode & BFFLAG_CREATE)
			om="w+b";
		else
			om="r+b";
	} else
		om="rb";

	// open file, stop on error
	if (!(dfile=fopen(name, om)))
		return 1;

	// success
	fileopen=1;
	filemode=mode;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movq (%rdi), %rax
callq *0x10(%rax)
cmpq $0x0, -0x18(%rbp)
je 0x16fc7
movq -0x18(%rbp), %rdi
callq 0x4100
cmpq $0x0, %rax
jne 0x16fd0
movl $0x1, -0x4(%rbp)
jmp 0x17047
movl -0x1c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x17000
movl -0x1c(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x16ff3
leaq 0x72ae(%rip), %rax      # 0x1e29b
movq %rax, -0x28(%rbp)
jmp 0x16ffe
leaq 0x72a5(%rip), %rax      # 0x1e29f
movq %rax, -0x28(%rbp)
jmp 0x1700b
leaq 0x729c(%rip), %rax      # 0x1e2a3
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x42a0
movq -0x30(%rbp), %rcx
movq %rax, 0x10(%rcx)
cmpq $0x0, %rax
jne 0x1702f
movl $0x1, -0x4(%rbp)
jmp 0x17047
movq -0x30(%rbp), %rax
movl $0x1, 0x8(%rax)
movl -0x1c(%rbp), %ecx
movl %ecx, 0xc(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: OpenFodder[P]SOS_Unpacker/capsimg/Core/DiskFile.cpp
// Function: CDiskFile::OpenAny(char**, unsigned int)
int CDiskFile::OpenAny(char **name, unsigned int mode)
{
	int pos;

	// if name list is valid
	if (name) {
		// try each name in order
		for (pos=0; name[pos]; pos++) {
			// open the file, return the name index position on success
			if (!Open(name[pos], mode))
				return pos;
		}
	}

	// all attempts failed
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x170bc
movl $0x0, -0x20(%rbp)
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x170ba
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl -0x1c(%rbp), %edx
callq 0x16f90
cmpl $0x0, %eax
jne 0x170ad
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x170c3
jmp 0x170af
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x17079
jmp 0x170bc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Core/DiskFile.cpp
// Function: CDiskFile::OpenAnyPath(char**, char const*, unsigned int)
int CDiskFile::OpenAnyPath(char **path, const char *name, unsigned int mode)
{
	int pos;

	// if name and path list are valid
	if (name && path) {
		// try each path entry in order
		for (pos=0; path[pos]; pos++) {
			// append name to current path entry
			int len=sprintf(tempname, "%s", path[pos]);
			sprintf(tempname+len, "%s", name);

			// open the file, return the name index position on success
			if (!Open(tempname, mode))
				return pos;
		}
	}

	// all attempts failed
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x17193
cmpq $0x0, -0x18(%rbp)
je 0x17193
movl $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x17191
movq -0x38(%rbp), %rdi
addq $0x1c, %rdi
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x7170(%rip), %rsi      # 0x1e2a6
movb $0x0, %al
callq 0x4080
movq -0x38(%rbp), %rdi
movl %eax, -0x2c(%rbp)
addq $0x1c, %rdi
movslq -0x2c(%rbp), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rdx
leaq 0x714c(%rip), %rsi      # 0x1e2a6
movb $0x0, %al
callq 0x4080
movq -0x38(%rbp), %rdi
movq %rdi, %rsi
addq $0x1c, %rsi
movl -0x24(%rbp), %edx
callq 0x16f90
cmpl $0x0, %eax
jne 0x17181
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1719a
jmp 0x17183
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1710c
jmp 0x17193
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Core/DiskFile.cpp
// Function: CDiskFile::Close()
int CDiskFile::Close()
{
	// finished if file is not open
	if (!dfile)
		return 0;

	// close file, set error
	int res=fclose(dfile) ? 1 : 0;

	// clear settings
	dfile=NULL;
	lastop=-1;
	Clear();

	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, 0x10(%rax)
jne 0x171d4
movl $0x0, -0x4(%rbp)
jmp 0x17211
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4230
movq -0x20(%rbp), %rdi
movl %eax, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x14(%rbp)
movq $0x0, 0x10(%rdi)
movl $0xffffffff, 0x18(%rdi) # imm = 0xFFFFFFFF
callq 0x4bd0
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Core/DiskFile.cpp
// Function: CDiskFile::Read(void*, unsigned long)
size_t CDiskFile::Read(void *buf, size_t size)
{
	// 0 bytes read if file is not open
	if (!dfile)
		return 0;

	// read/write change
	if (lastop != 0) {
		fseek(dfile, 0, SEEK_CUR);
		lastop=0;
	}

	// read the file
	return fread(buf, 1, size, dfile);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, 0x10(%rax)
jne 0x1724d
movq $0x0, -0x8(%rbp)
jmp 0x17296
movq -0x28(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x17278
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x4270
movq -0x28(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq 0x10(%rax), %rcx
movl $0x1, %esi
callq 0x4380
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: OpenFodder[P]SOS_Unpacker/capsimg/Core/DiskFile.cpp
// Function: CDiskFile::Write(void*, unsigned long)
size_t CDiskFile::Write(void *buf, size_t size)
{
	// 0 bytes written if file is not open or read-only
	if (!dfile || !(filemode & BFFLAG_WRITE))
		return 0;

	// read/write change
	if (lastop != 1) {
		fseek(dfile, 0, SEEK_CUR);
		lastop=1;
	}

	// read the file
	return fwrite(buf, 1, size, dfile);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, 0x10(%rax)
je 0x172d2
movq -0x28(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x172dc
movq $0x0, -0x8(%rbp)
jmp 0x17325
movq -0x28(%rbp), %rax
cmpl $0x1, 0x18(%rax)
je 0x17307
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0x4270
movq -0x28(%rbp), %rax
movl $0x1, 0x18(%rax)
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq 0x10(%rax), %rcx
movl $0x1, %esi
callq 0x4450
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: OpenFodder[P]SOS_Unpacker/capsimg/Core/DiskFile.cpp
// Function: CDiskFile::Seek(long, int)
long CDiskFile::Seek(long pos, int mode)
{
	// default result 
	long res=0;

	// return default result if file is not open
	if (!dfile)
		return res;

	// select seek mode
	int sm;

	switch (mode) {
		case Start:
			pos=0;
			sm=SEEK_SET;
			break;

		case Position:
			sm=SEEK_SET;
			break;

		case Current:
			sm = SEEK_CUR;
			break;

		case End:
			pos=0;
			sm=SEEK_END;
			break;

		default:
			return res;
	}

	// seek, stop on error
	if (fseek(dfile, pos, sm))
		return res;

	// get the current file position, stop on error
	pos=ftell(dfile);
	if (pos < 0)
		return res;

	return pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x0, 0x10(%rax)
jne 0x17367
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x17413
movl -0x1c(%rbp), %eax
movq %rax, -0x40(%rbp)
subq $0x3, %rax
ja 0x173bc
movq -0x40(%rbp), %rax
leaq 0x6f01(%rip), %rcx      # 0x1e280
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x0, -0x18(%rbp)
movl $0x0, -0x2c(%rbp)
jmp 0x173c6
movl $0x0, -0x2c(%rbp)
jmp 0x173c6
movl $0x1, -0x2c(%rbp)
jmp 0x173c6
movq $0x0, -0x18(%rbp)
movl $0x2, -0x2c(%rbp)
jmp 0x173c6
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x17413
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
movl -0x2c(%rbp), %edx
callq 0x4270
cmpl $0x0, %eax
je 0x173e9
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x17413
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4030
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0x1740b
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x17413
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Core/DiskFile.cpp
// Function: CDiskFile::GetSize()
long CDiskFile::GetSize()
{
	// default result 
	long res=0;

	// return default result if file is not open
	if (!dfile)
		return res;

	// get the current file position, stop on error
	long pos=ftell(dfile);
	if (pos < 0)
		return res;

	// get the file size
	long size=Seek(0, End);

	// restore file position, stop on error
	if (Seek(pos, Position) != pos)
		return res;

	return size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x0, 0x10(%rax)
jne 0x1744d
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x174b1
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4030
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jge 0x1746f
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x174b1
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
xorl %ecx, %ecx
movl %ecx, %esi
movl $0x3, %edx
callq *0x28(%rax)
movq -0x30(%rbp), %rdi
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rsi
movq (%rdi), %rax
movl $0x1, %edx
callq *0x28(%rax)
cmpq -0x20(%rbp), %rax
je 0x174a9
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x174b1
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Core/DiskFile.cpp
// Function: CDiskFile::GetPosition()
long CDiskFile::GetPosition()
{
	// default result 
	long res=0;

	// return default result if file is not open
	if (!dfile)
		return res;

	long pos=ftell(dfile);
	if (pos < 0)
		return res;

	return pos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x0, 0x10(%rax)
jne 0x174ed
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x17517
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4030
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jge 0x1750f
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x17517
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/Core/DiskFile.cpp
// Function: CDiskFile::MakePath(char const*)
void CDiskFile::MakePath(const char *filename)
{
	if (!filename)
		return;

	char path[MAX_FILENAMELEN];

	// create each directory level delimited by / or \ if does not exist
	for (int rpos = 0, wpos = 0; filename[rpos]; rpos++) {
		if (filename[rpos] == '/' || filename[rpos] == '\\') {
			path[wpos] = 0;

			if (_access(path, 0) == -1)
				_mkdir(path);
		}

		path[wpos++] = filename[rpos];
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x1755b
jmp 0x1761a
movl $0x0, -0x214(%rbp)
movl $0x0, -0x218(%rbp)
movq -0x8(%rbp), %rax
movslq -0x214(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x1761a
movq -0x8(%rbp), %rax
movslq -0x214(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
je 0x175ac
movq -0x8(%rbp), %rax
movslq -0x214(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x5c, %eax
jne 0x175de
movslq -0x218(%rbp), %rax
movb $0x0, -0x210(%rbp,%rax)
leaq -0x210(%rbp), %rdi
xorl %esi, %esi
callq 0x43f0
cmpl $-0x1, %eax
jne 0x175dc
leaq -0x210(%rbp), %rdi
xorl %esi, %esi
callq 0x4110
jmp 0x175de
movq -0x8(%rbp), %rax
movslq -0x214(%rbp), %rcx
movb (%rax,%rcx), %cl
movl -0x218(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x218(%rbp)
cltq
movb %cl, -0x210(%rbp,%rax)
movl -0x214(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x214(%rbp)
jmp 0x1756f
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: OpenFodder[P]SOS_Unpacker/capsimg/CAPSImg/DiskImage.cpp
// Function: CDiskImage::Destroy()
void CDiskImage::Destroy()
{
	// unlock all track data
	UnlockTrack(true);

	// invalid image
	memset(&dii, 0, sizeof(dii));

	// read only
	dii.readonly=true;

	// track lock to raw format
	dii.rawlock=true;

	// no track data
	dticnt=0;
	delete [] dti;
	dti=NULL;
	dticyl=0;
	dtihed=0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movl $0x1, %esi
callq 0x17e50
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x4140
movq -0x18(%rbp), %rax
movl $0x1, 0x14(%rax)
movl $0x1, 0x1c(%rax)
movl $0x0, 0xa0(%rax)
movq 0xb0(%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x17b98
movq -0x10(%rbp), %rdi
callq 0x42e0
movq -0x18(%rbp), %rax
movq $0x0, 0xb0(%rax)
movl $0x0, 0xa4(%rax)
movl $0x0, 0xa8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)