LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: saveoutput
int saveoutput(char* oname, char* buf, trdFile hd) {
	int len;
	if ((hd.lnh + (hd.lnl ? 1 : 0)) == hd.slen) {
		len = hd.lnl | (hd.lnh << 8);
	} else {
		len = hd.slen << 8;
	}
	int res;
	if (opt.asHobeta) {
		char hbuf[0x10010];
		memcpy(hbuf, (char*)&hd, 13);
		hbuf[13] = 0x00;
		hbuf[14] = hd.slen;
		int crc = ((105 + 257 * stdAccumulate((unsigned char*)hbuf, 15, 0)) & 0xffff);
		hbuf[15] = crc & 0xff;
		hbuf[16] = ((crc & 0xff00) >> 8);
		memcpy(hbuf + 17, buf, len);
		res = savefile(oname, hbuf, len + 17);
	} else {
		res = savefile(oname, buf, len);
	}
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10050, %rsp          # imm = 0x10050
movq %rdx, -0x10(%rbp)
movq %rcx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movzbl -0x4(%rbp), %eax
movzbl -0x5(%rbp), %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
addl %ecx, %eax
movzbl -0x3(%rbp), %ecx
cmpl %ecx, %eax
jne 0x4021ec
movzbl -0x5(%rbp), %eax
movzbl -0x4(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movl %eax, -0x24(%rbp)
jmp 0x4021f6
movzbl -0x3(%rbp), %eax
shll $0x8, %eax
movl %eax, -0x24(%rbp)
movb 0xd01b4(%rip), %al      # 0x4d23b0
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x4022b9
movq -0x10(%rbp), %rax
movq %rax, -0x10040(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x10038(%rbp)
movb -0x4(%rbp), %al
movb %al, -0x10034(%rbp)
movb $0x0, -0x10033(%rbp)
movb -0x3(%rbp), %al
movb %al, -0x10032(%rbp)
leaq -0x10040(%rbp), %rdi
movl $0xf, %esi
xorl %edx, %edx
callq 0x401cf0
imull $0x101, %eax, %eax      # imm = 0x101
addl $0x69, %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x10044(%rbp)
movl -0x10044(%rbp), %eax
andl $0xff, %eax
movb %al, -0x10031(%rbp)
movl -0x10044(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, -0x10030(%rbp)
leaq -0x10040(%rbp), %rdi
addq $0x11, %rdi
movq -0x20(%rbp), %rsi
movslq -0x24(%rbp), %rdx
callq 0x401040
movq -0x18(%rbp), %rdi
leaq -0x10040(%rbp), %rsi
movl -0x24(%rbp), %edx
addl $0x11, %edx
callq 0x4018e0
movl %eax, -0x28(%rbp)
jmp 0x4022cc
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x4018e0
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
addq $0x10050, %rsp          # imm = 0x10050
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: tapAddBlock
void tapAddBlock(FILE* file, int len, char* buf, int type) {
	int crc = type & 0xff;
	for (int i = 0; i < len; i++) {
		crc ^= buf[i];
	}
	fputc((len + 2) & 0xff, file);
	fputc(((len + 2) >> 8) & 0xff, file);
	fputc(type, file);
	fwrite(buf, len, 1, file);
	fputc(crc, file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
andl $0xff, %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x40232d
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
xorl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x402308
movl -0xc(%rbp), %edi
addl $0x2, %edi
andl $0xff, %edi
movq -0x8(%rbp), %rsi
callq 0x419480
movl -0xc(%rbp), %edi
addl $0x2, %edi
sarl $0x8, %edi
andl $0xff, %edi
movq -0x8(%rbp), %rsi
callq 0x419480
movl -0x1c(%rbp), %edi
movq -0x8(%rbp), %rsi
callq 0x419480
movq -0x18(%rbp), %rdi
movslq -0xc(%rbp), %rsi
movq -0x8(%rbp), %rcx
movl $0x1, %edx
callq 0x415860
movl -0x20(%rbp), %edi
movq -0x8(%rbp), %rsi
callq 0x419480
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: tapList
void tapList(char* path) {
	FILE* file = fopen(path, "rb");
	if (!file) {
		printf("Can't open image '%s'\n",path);
		return;
	}
	int len;
	tHead hd;
	int blk = 0;
	printf("Name\t\tType\tStart\tSize\n");
	printf("------------------------------------\n");
	while (1) {
		len = fgetc(file);
		len |= (fgetc(file) << 8);
		if (feof(file)) break;
		int type = fgetc(file);
		if (type == 0x00) {
			fread((char*)&hd, sizeof(tHead), 1, file);
			printf("%.10s\t%s\t%i\t%i\n",hd.name, hd.type ? "Bytes" : "Prog", hd.asl | (hd.ash << 8), hd.dll | (hd.dlh << 8));
			fgetc(file);		// skip crc
		} else {
			fseek(file, len - 1, SEEK_CUR);
			printf("blk-%.3i\t\t\t\t%i\n",blk,len - 2);
		}
		blk++;
	}
	fclose(file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x9cc2d(%rip), %rsi     # 0x49f004
callq 0x415510
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x4023fe
movq -0x8(%rbp), %rsi
leaq 0x9cc90(%rip), %rdi     # 0x49f082
movb $0x0, %al
callq 0x40eab0
jmp 0x402516
movl $0x0, -0x2c(%rbp)
leaq 0x9cc8d(%rip), %rdi     # 0x49f099
movb $0x0, %al
callq 0x40eab0
leaq 0x9cc96(%rip), %rdi     # 0x49f0b0
movb $0x0, %al
callq 0x40eab0
movq -0x10(%rbp), %rdi
callq 0x4196a0
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4196a0
shll $0x8, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4193b0
cmpl $0x0, %eax
je 0x402452
jmp 0x40250d
movq -0x10(%rbp), %rdi
callq 0x4196a0
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x4024d1
movq -0x10(%rbp), %rcx
leaq -0x25(%rbp), %rdi
movl $0x11, %esi
movl $0x1, %edx
callq 0x415610
leaq -0x25(%rbp), %rsi
addq $0x1, %rsi
movsbl -0x25(%rbp), %ecx
leaq 0x9cc5e(%rip), %rdx     # 0x49f0ec
leaq 0x9cc51(%rip), %rax     # 0x49f0e6
cmpl $0x0, %ecx
cmovneq %rax, %rdx
movzbl -0x18(%rbp), %ecx
movzbl -0x17(%rbp), %eax
shll $0x8, %eax
orl %eax, %ecx
movzbl -0x1a(%rbp), %r8d
movzbl -0x19(%rbp), %eax
shll $0x8, %eax
orl %eax, %r8d
leaq 0x9cc17(%rip), %rdi     # 0x49f0d6
movb $0x0, %al
callq 0x40eab0
movq -0x10(%rbp), %rdi
callq 0x4196a0
jmp 0x4024ff
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
movl $0x1, %edx
callq 0x4195c0
movl -0x2c(%rbp), %esi
movl -0x14(%rbp), %edx
subl $0x2, %edx
leaq 0x9cbf9(%rip), %rdi     # 0x49f0f1
movb $0x0, %al
callq 0x40eab0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x402421
movq -0x10(%rbp), %rdi
callq 0x4150d0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: tapPush
void tapPush(char* iname, char* fname) {
	char buf[0x10000];
	int flen = readfile(fname, buf, 0xfffd);
	if (flen < 0) return;	
	FILE* file = fopen(iname, "ab");
	if (!file) {
		printf("Can't open '%s' for append\n", iname);
		return;
	}
	if (!opt.headLess) {
		tHead hd;
		memset(hd.name, 0x20, 10);
		xName nm = cutName(fname);
		memcpy(hd.name, nm.name, 10);
		hd.dll = flen & 0xff;
		hd.dlh = (flen >> 8) & 0xff;
		if (opt.isBasic) {
			hd.type = 0x00;
			hd.asl = opt.aStart & 0xff;
			hd.ash = (opt.aStart >> 8) & 0xff;
			hd.pll = hd.dll;
			hd.plh = hd.dlh;
		} else {
			hd.type = 0x03;
			hd.asl = 0;
			hd.ash = 0;
			hd.pll = 0;
			hd.plh = 0x80;
		}
		tapAddBlock(file, sizeof(tHead), (char*)&hd, 0x00);
	}
	tapAddBlock(file, flen, buf, 0xff);		// data
	fclose(file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10050, %rsp          # imm = 0x10050
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x10010(%rbp), %rsi
movl $0xfffd, %edx           # imm = 0xFFFD
callq 0x401810
movl %eax, -0x10014(%rbp)
cmpl $0x0, -0x10014(%rbp)
jge 0x40255c
jmp 0x40270c
movq -0x8(%rbp), %rdi
leaq 0x9cb9a(%rip), %rsi     # 0x49f101
callq 0x415510
movq %rax, -0x10020(%rbp)
cmpq $0x0, -0x10020(%rbp)
jne 0x402594
movq -0x8(%rbp), %rsi
leaq 0x9cb7c(%rip), %rdi     # 0x49f104
movb $0x0, %al
callq 0x40eab0
jmp 0x40270c
movb 0xcfe16(%rip), %al      # 0x4d23b0
shrb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x4026e2
movabsq $0x2020202020202020, %rax # imm = 0x2020202020202020
movq %rax, -0x10030(%rbp)
movw $0x2020, -0x10028(%rbp) # imm = 0x2020
movq -0x10(%rbp), %rdi
callq 0x401b60
movl %edx, %ecx
movl %ecx, -0x10048(%rbp)
shrq $0x20, %rdx
movb %dl, %cl
movb %cl, -0x10044(%rbp)
movq %rax, -0x10050(%rbp)
movq -0x10050(%rbp), %rax
movq %rax, -0x1003e(%rbp)
movl -0x10048(%rbp), %eax
movl %eax, -0x10036(%rbp)
movb -0x10044(%rbp), %al
movb %al, -0x10032(%rbp)
movq -0x1003e(%rbp), %rax
movq %rax, -0x10030(%rbp)
movw -0x10036(%rbp), %ax
movw %ax, -0x10028(%rbp)
movl -0x10014(%rbp), %eax
andl $0xff, %eax
movb %al, -0x10026(%rbp)
movl -0x10014(%rbp), %eax
sarl $0x8, %eax
andl $0xff, %eax
movb %al, -0x10025(%rbp)
movb 0xcfd5b(%rip), %al      # 0x4d23b0
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x4026a5
movb $0x0, -0x10031(%rbp)
movl 0xcfd48(%rip), %eax     # 0x4d23b4
andl $0xff, %eax
movb %al, -0x10024(%rbp)
movl 0xcfd37(%rip), %eax     # 0x4d23b4
sarl $0x8, %eax
andl $0xff, %eax
movb %al, -0x10023(%rbp)
movb -0x10026(%rbp), %al
movb %al, -0x10022(%rbp)
movb -0x10025(%rbp), %al
movb %al, -0x10021(%rbp)
jmp 0x4026c8
movb $0x3, -0x10031(%rbp)
movb $0x0, -0x10024(%rbp)
movb $0x0, -0x10023(%rbp)
movb $0x0, -0x10022(%rbp)
movb $-0x80, -0x10021(%rbp)
movq -0x10020(%rbp), %rdi
movl $0x11, %esi
leaq -0x10031(%rbp), %rdx
xorl %ecx, %ecx
callq 0x4022e0
movq -0x10020(%rbp), %rdi
movl -0x10014(%rbp), %esi
leaq -0x10010(%rbp), %rdx
movl $0xff, %ecx
callq 0x4022e0
movq -0x10020(%rbp), %rdi
callq 0x4150d0
addq $0x10050, %rsp          # imm = 0x10050
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: sclList
void sclList(char* path) {
	FILE* file = fopen(path, "rb");
	if (!file) {
		printf("Can't open image '%s'\n",path);
		return;
	}
	trdFile hd;
	printf("Name\t\tExt\tStart\tSize\tSLen\n---------------------------\n");
	fseek(file, 8, SEEK_SET);
	int cnt = fgetc(file);
	unsigned short start, len;
	while (cnt > 0) {
		fread((char*)&hd, 14, 1, file);
		start = hd.stl | (hd.sth << 8);
		len = hd.lnl | (hd.lnh << 8);
		printf("%.8s\t%c\t%i\t%i\t%i\n",hd.name, hd.ext, start, len, hd.slen);
		cnt--;
	}
	fclose (file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x9c81d(%rip), %rsi     # 0x49f004
callq 0x415510
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x40280e
movq -0x8(%rbp), %rsi
leaq 0x9c880(%rip), %rdi     # 0x49f082
movb $0x0, %al
callq 0x40eab0
jmp 0x4028af
leaq 0x9c91e(%rip), %rdi     # 0x49f133
movb $0x0, %al
callq 0x40eab0
movq -0x10(%rbp), %rdi
movl $0x8, %esi
xorl %edx, %edx
callq 0x4195c0
movq -0x10(%rbp), %rdi
callq 0x4196a0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jle 0x4028a6
movq -0x10(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0xe, %esi
movl $0x1, %edx
callq 0x415610
movzbl -0x17(%rbp), %eax
movzbl -0x16(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movw %ax, -0x26(%rbp)
movzbl -0x15(%rbp), %eax
movzbl -0x14(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movw %ax, -0x28(%rbp)
leaq -0x20(%rbp), %rsi
movsbl -0x18(%rbp), %edx
movzwl -0x26(%rbp), %ecx
movzwl -0x28(%rbp), %r8d
movzbl -0x13(%rbp), %r9d
leaq 0x9c8d6(%rip), %rdi     # 0x49f16a
movb $0x0, %al
callq 0x40eab0
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x402838
movq -0x10(%rbp), %rdi
callq 0x4150d0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: sclSeekFile
int sclSeekFile(FILE* file, char* name, trdFile* hd) {
	fseek(file, 8, SEEK_SET);
	int cnt = fgetc(file);
	int find = 0;
	int pos = 9;
	while ((cnt > 0) && !find) {
		fread((char*)hd, 14, 1, file);
		if (memcmp((char*)hd, name, 9) == 0) {
			find = 1;
		} else {
			pos += 14;
			cnt--;
		}
	}
	return find ? pos : -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl $0x8, %esi
xorl %edx, %edx
callq 0x4195c0
movq -0x8(%rbp), %rdi
callq 0x4196a0
movl %eax, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x9, -0x24(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x1c(%rbp)
movb %al, -0x25(%rbp)
jle 0x402f35
cmpl $0x0, -0x20(%rbp)
setne %al
xorb $-0x1, %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0x402f3e
jmp 0x402f89
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl $0xe, %esi
movl $0x1, %edx
callq 0x415610
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x9, %edx
callq 0x401088
cmpl $0x0, %eax
jne 0x402f75
movl $0x1, -0x20(%rbp)
jmp 0x402f87
movl -0x24(%rbp), %eax
addl $0xe, %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x402f1e
cmpl $0x0, -0x20(%rbp)
je 0x402f97
movl -0x24(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x402fa1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x2c(%rbp)
jmp 0x402fa1
movl -0x2c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: sclRename
void sclRename(char* ipath, char* oname, char* nname) {
	FILE* file = fopen(ipath, "r+");
	if (!file) {
		printf("Can't open file '%s'\n",ipath);
		return;
	}
	char nbuf[9];
	makeName(oname, nbuf);
	trdFile hd;
	int pos = sclSeekFile(file, nbuf, &hd);
	if (pos < 0) {
		printf("File '%s' not found in image\n",oname);
	} else {
		int oldSum = getSum(nbuf, 9);
		makeName(nname, nbuf);
		int dif = getSum(nbuf, 9) - oldSum;	// diff to new CRC
		fseek(file, pos, SEEK_SET);		// read old CRC
		fwrite(nbuf, 9, 1, file);
		fseek(file, -4, SEEK_END);
		int crc = fgeti(file);
		crc += dif;				// change it
		fseek(file, -4, SEEK_END);		// write back
		fputi(file, crc);
	}
	fclose(file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x9c214(%rip), %rsi     # 0x49f1e3
callq 0x415510
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x402ff6
movq -0x8(%rbp), %rsi
leaq 0x9c01d(%rip), %rdi     # 0x49f007
movb $0x0, %al
callq 0x40eab0
jmp 0x4030e0
movq -0x10(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x401e00
movq -0x20(%rbp), %rdi
leaq -0x29(%rbp), %rsi
leaq -0x39(%rbp), %rdx
callq 0x402ee0
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jge 0x403034
movq -0x10(%rbp), %rsi
leaq 0x9c19d(%rip), %rdi     # 0x49f1c5
movb $0x0, %al
callq 0x40eab0
jmp 0x4030d7
leaq -0x29(%rbp), %rdi
movl $0x9, %esi
callq 0x401f10
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x401e00
leaq -0x29(%rbp), %rdi
movl $0x9, %esi
callq 0x401f10
subl -0x44(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x4195c0
leaq -0x29(%rbp), %rdi
movq -0x20(%rbp), %rcx
movl $0x9, %esi
movl $0x1, %edx
callq 0x415860
movq -0x20(%rbp), %rdi
movq $-0x4, %rsi
movl $0x2, %edx
callq 0x4195c0
movq -0x20(%rbp), %rdi
callq 0x401d30
movl %eax, -0x4c(%rbp)
movl -0x48(%rbp), %eax
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x20(%rbp), %rdi
movq $-0x4, %rsi
movl $0x2, %edx
callq 0x4195c0
movq -0x20(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x401d90
movq -0x20(%rbp), %rdi
callq 0x4150d0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: trdCreate
void trdCreate(char* path) {
	char buf[0xa0000];
	memset(buf, 0x00, 0xa0000);
	buf[0x8e2] = 0x01;
	buf[0x8e3] = 0x16;
	buf[0x8e5] = 0xf0;
	buf[0x8e6] = 0x09;
	buf[0x8e7] = 0x10;
	FILE *file = fopen(path, "wb");
	if (!file) {
		printf("Can't write to file '%s'\n",path);
	} else {
		fwrite(buf, 0xa0000, 1, file);
		fclose(file);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0020, %rsp          # imm = 0xA0020
movq %rdi, -0x8(%rbp)
leaq -0xa0010(%rbp), %rdi
xorl %esi, %esi
movl $0xa0000, %edx          # imm = 0xA0000
callq 0x4010a0
movb $0x1, -0x9f72e(%rbp)
movb $0x16, -0x9f72d(%rbp)
movb $-0x10, -0x9f72b(%rbp)
movb $0x9, -0x9f72a(%rbp)
movb $0x10, -0x9f729(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x9bf08(%rip), %rsi     # 0x49f048
callq 0x415510
movq %rax, -0xa0018(%rbp)
cmpq $0x0, -0xa0018(%rbp)
jne 0x40316a
movq -0x8(%rbp), %rsi
leaq 0x9c085(%rip), %rdi     # 0x49f1e6
movb $0x0, %al
callq 0x40eab0
jmp 0x403193
leaq -0xa0010(%rbp), %rdi
movq -0xa0018(%rbp), %rcx
movl $0xa0000, %esi          # imm = 0xA0000
movl $0x1, %edx
callq 0x415860
movq -0xa0018(%rbp), %rdi
callq 0x4150d0
addq $0xa0020, %rsp          # imm = 0xA0020
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: trdList
void trdList(char* path) {
	FILE* file = fopen(path, "rb");
	if (!file) {
		printf("Can't open image '%s'\n", path);
		return;
	}
	printf("Name\t\tExt\tStart\tSize\tSLen\tSec\tTrk\n---------------------------\n");
	trdFile hd;
	int cnt = 0;
	int start,len;
	while (cnt < 128) {
		fread((char*)&hd, 16, 1, file);
		if (hd.name[0] == 0x00) break;
		if (hd.name[0] != 0x01) {
			start = hd.stl | (hd.sth << 8);
			len = hd.lnl | (hd.lnh << 8);
			printf("%.8s\t%c\t%i\t%i\t%i\t%i\t%i\n", hd.name, hd.ext, start, len, hd.slen, hd.sec, hd.trk);
		}
	}
	fclose(file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x9be4d(%rip), %rsi     # 0x49f004
callq 0x415510
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x4031de
movq -0x8(%rbp), %rsi
leaq 0x9beb0(%rip), %rdi     # 0x49f082
movb $0x0, %al
callq 0x40eab0
jmp 0x40328c
leaq 0x9c01b(%rip), %rdi     # 0x49f200
movb $0x0, %al
callq 0x40eab0
movl $0x0, -0x24(%rbp)
cmpl $0x80, -0x24(%rbp)
jge 0x403283
movq -0x10(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x10, %esi
movl $0x1, %edx
callq 0x415610
movsbl -0x20(%rbp), %eax
cmpl $0x0, %eax
jne 0x403222
jmp 0x403283
movsbl -0x20(%rbp), %eax
cmpl $0x1, %eax
je 0x40327e
movzbl -0x17(%rbp), %eax
movzbl -0x16(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movl %eax, -0x28(%rbp)
movzbl -0x15(%rbp), %eax
movzbl -0x14(%rbp), %ecx
shll $0x8, %ecx
orl %ecx, %eax
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rsi
movsbl -0x18(%rbp), %edx
movl -0x28(%rbp), %ecx
movl -0x2c(%rbp), %r8d
movzbl -0x13(%rbp), %r9d
movzbl -0x12(%rbp), %r10d
movzbl -0x11(%rbp), %eax
leaq 0x9bfd0(%rip), %rdi     # 0x49f23f
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x40eab0
jmp 0x4031f3
movq -0x10(%rbp), %rdi
callq 0x4150d0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: trd_put_data
void trd_put_data(char* img, char* buf, int trk, int sec, int len, int dt) {
	if ((dt == 0x18) || (dt == 0x19)) {
		sec = (trk << 5) | (sec & 0x0f);
		char* ptr = buf;
		while (len > 0) {
			memcpy(img + (sec << 8), ptr, 0x100);
			sec++;
			if ((sec & 0x0f) == 0)
				sec += 0x10;
			ptr += 0x100;
			len--;
		}
	} else {
		sec = (trk << 4) | (sec & 0x0f);
		memcpy(img + (sec << 8), buf, len << 8);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
cmpl $0x18, -0x20(%rbp)
je 0x4032ca
cmpl $0x19, -0x20(%rbp)
jne 0x40333e
movl -0x14(%rbp), %eax
shll $0x5, %eax
movl -0x18(%rbp), %ecx
andl $0xf, %ecx
orl %ecx, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x40333c
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %eax
shll $0x8, %eax
cltq
addq %rax, %rdi
movq -0x28(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x401040
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x403323
movl -0x18(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x18(%rbp)
movq -0x28(%rbp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4032e3
jmp 0x403370
movl -0x14(%rbp), %eax
shll $0x4, %eax
movl -0x18(%rbp), %ecx
andl $0xf, %ecx
orl %ecx, %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0x18(%rbp), %eax
shll $0x8, %eax
cltq
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x1c(%rbp), %eax
shll $0x8, %eax
movslq %eax, %rdx
callq 0x401040
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: trdSeekFile
int trdSeekFile(FILE* file, char* name, trdFile* hd) {
	int find = 0;
	int cnt = 0;
	rewind(file);
	while ((cnt < 128) && !find) {
		fread((char*)hd, 16, 1, file);
		if (hd->name[0] == 0x00) break;
		if (memcmp((char*)hd, name, 9) == 0) {
			find = 1;
		}
		cnt++;
	}
	return find ? (cnt - 1) << 4 : -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4197c0
xorl %eax, %eax
cmpl $0x80, -0x20(%rbp)
movb %al, -0x21(%rbp)
jge 0x403655
cmpl $0x0, -0x1c(%rbp)
setne %al
xorb $-0x1, %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x40365e
jmp 0x4036ac
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl $0x10, %esi
movl $0x1, %edx
callq 0x415610
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x403683
jmp 0x4036ac
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x9, %edx
callq 0x401088
cmpl $0x0, %eax
jne 0x4036a1
movl $0x1, -0x1c(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x40363b
cmpl $0x0, -0x1c(%rbp)
je 0x4036c0
movl -0x20(%rbp), %eax
subl $0x1, %eax
shll $0x4, %eax
movl %eax, -0x28(%rbp)
jmp 0x4036ca
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x28(%rbp)
jmp 0x4036ca
movl -0x28(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: trd_get_data
void trd_get_data(FILE* file, char* buf, int trk, int sec, int len, int dt) {
	if ((dt == 0x18) || (dt == 0x19)) {
		fseek(file, ((trk << 5) | (sec & 0x0f)) << 8, SEEK_SET);
		char* ptr = buf;
		while (len > 0) {
			fread(ptr, 0x100, 1, file);		// read 1 sec
			if ((ftell(file) & 0xfff) == 0) {	// if eot
				fseek(file, 0x1000, SEEK_CUR);	// skip 4Kb
			}
			ptr += 0x100;
			len--;
		}
	} else {
		fseek(file, ((trk << 4) | (sec & 0x0f)) << 8, SEEK_SET);
		fread(buf, len << 8, 1, file);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
cmpl $0x18, -0x20(%rbp)
je 0x40370e
cmpl $0x19, -0x20(%rbp)
jne 0x403795
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
shll $0x5, %eax
movl -0x18(%rbp), %ecx
andl $0xf, %ecx
orl %ecx, %eax
shll $0x8, %eax
movslq %eax, %rsi
xorl %edx, %edx
callq 0x4195c0
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x403793
movq -0x28(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl $0x100, %esi            # imm = 0x100
movl $0x1, %edx
callq 0x415610
movq -0x8(%rbp), %rdi
callq 0x415710
andq $0xfff, %rax            # imm = 0xFFF
cmpq $0x0, %rax
jne 0x40377a
movq -0x8(%rbp), %rdi
movl $0x1000, %esi           # imm = 0x1000
movl $0x1, %edx
callq 0x4195c0
movq -0x28(%rbp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x403735
jmp 0x4037cf
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
shll $0x4, %eax
movl -0x18(%rbp), %ecx
andl $0xf, %ecx
orl %ecx, %eax
shll $0x8, %eax
movslq %eax, %rsi
xorl %edx, %edx
callq 0x4195c0
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
shll $0x8, %eax
movslq %eax, %rsi
movq -0x8(%rbp), %rcx
movl $0x1, %edx
callq 0x415610
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: trdRename
void trdRename(char* ipath, char* oname, char* nname) {
	FILE* file = fopen(ipath, "r+");
	if (!file) {
		printf("Can't open image '%s'\n",ipath);
		return;
	}
	char nbuf[9];
	makeName(oname, nbuf);
	trdFile hd;
	int pos = trdSeekFile(file, nbuf, &hd);
	if (pos < 0) {
		printf("Can't find file '%s' in image\n",oname);
	} else {
		makeName(nname, nbuf);
		fseek(file, pos, SEEK_SET);
		fwrite(nbuf, 9, 1, file);
	}
	fclose(file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x9b7c4(%rip), %rsi     # 0x49f1e3
callq 0x415510
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x403a43
movq -0x8(%rbp), %rsi
leaq 0x9b648(%rip), %rdi     # 0x49f082
movb $0x0, %al
callq 0x40eab0
jmp 0x403aba
movq -0x10(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x401e00
movq -0x20(%rbp), %rdi
leaq -0x29(%rbp), %rsi
leaq -0x39(%rbp), %rdx
callq 0x403610
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jge 0x403a7e
movq -0x10(%rbp), %rsi
leaq 0x9b824(%rip), %rdi     # 0x49f299
movb $0x0, %al
callq 0x40eab0
jmp 0x403ab1
movq -0x18(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x401e00
movq -0x20(%rbp), %rdi
movslq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x4195c0
leaq -0x29(%rbp), %rdi
movq -0x20(%rbp), %rcx
movl $0x9, %esi
movl $0x1, %edx
callq 0x415860
movq -0x20(%rbp), %rdi
callq 0x4150d0
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: create
void create(char* path) {
	if (testExt(path, "tap")) {
		tapCreate(path);
	} else if (testExt(path, "scl")) {
		sclCreate(path);
	} else if (testExt(path, "trd")) {
		trdCreate(path);
	} else {
		printf("Unknown type, use TAP SCL TRD please\n");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x9b596(%rip), %rsi     # 0x49f06d
callq 0x401970
cmpl $0x0, %eax
je 0x403aec
movq -0x8(%rbp), %rdi
callq 0x402390
jmp 0x403b3e
movq -0x8(%rbp), %rdi
leaq 0x9b57a(%rip), %rsi     # 0x49f071
callq 0x401970
cmpl $0x0, %eax
je 0x403b0c
movq -0x8(%rbp), %rdi
callq 0x402780
jmp 0x403b3c
movq -0x8(%rbp), %rdi
leaq 0x9b567(%rip), %rsi     # 0x49f07e
callq 0x401970
cmpl $0x0, %eax
je 0x403b2c
movq -0x8(%rbp), %rdi
callq 0x4030f0
jmp 0x403b3a
leaq 0x9b785(%rip), %rdi     # 0x49f2b8
movb $0x0, %al
callq 0x40eab0
jmp 0x403b3c
jmp 0x403b3e
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: list
void list(char* path) {
	int mode = getFileType(path);
	switch (mode) {
		case TYPE_TAP:
			tapList(path);
			break;
		case TYPE_SCL:
			sclList(path);
			break;
		case TYPE_TRD:
			trdList(path);
			break;
		default:
			printf("Unknown image type\n");
			break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x401a20
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x10(%rbp)
subl $0x1, %eax
je 0x403b94
jmp 0x403b75
movl -0x10(%rbp), %eax
subl $0x2, %eax
je 0x403b9f
jmp 0x403b7f
movl -0x10(%rbp), %eax
subl $0x3, %eax
jne 0x403baa
jmp 0x403b89
movq -0x8(%rbp), %rdi
callq 0x4023c0
jmp 0x403bb8
movq -0x8(%rbp), %rdi
callq 0x4027d0
jmp 0x403bb8
movq -0x8(%rbp), %rdi
callq 0x4031a0
jmp 0x403bb8
leaq 0x9b72d(%rip), %rdi     # 0x49f2de
movb $0x0, %al
callq 0x40eab0
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: push
void push(char* ipath, char* fpath) {
	int type = getFileType(ipath);
	switch(type) {
		case TYPE_TAP:
			tapPush(ipath, fpath);
			break;
		case TYPE_SCL:
			sclPush(ipath, fpath);
			break;
		case TYPE_TRD:
			trdPush(ipath, fpath);
			break;
		default:
			printf("Unknown image type\n");
			break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x401a20
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
subl $0x1, %eax
je 0x403c0c
jmp 0x403be9
movl -0x18(%rbp), %eax
subl $0x2, %eax
je 0x403c1b
jmp 0x403bf3
movl -0x18(%rbp), %eax
subl $0x3, %eax
jne 0x403c2a
jmp 0x403bfd
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x402520
jmp 0x403c38
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4028c0
jmp 0x403c38
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x403380
jmp 0x403c38
leaq 0x9b6ad(%rip), %rdi     # 0x49f2de
movb $0x0, %al
callq 0x40eab0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: pop
void pop(char* ipath, char* fname, char* oname) {
	if (!oname) {
		if (opt.asHobeta) {
			char fpath[1024];
			memset(fpath, 0, 1024);
			char* pDot = strrchr(fname,'.');
			if (pDot) {
				memcpy(fpath, fname, pDot - fname + 1);
				strcat(fpath,"$");
				strcat(fpath,pDot + 1);
				oname = fpath;
			} else {
				oname = fname;
			}
		} else {
			oname = fname;
		}
	}
	int type = getFileType(ipath);
	switch(type) {
		case TYPE_TAP:
			tapPop(ipath, fname, oname);
			break;
		case TYPE_SCL:
			sclPop(ipath, fname, oname);
			break;
		case TYPE_TRD:
			trdPop(ipath, fname, oname);
			break;
		default:
			printf("Unknown image type\n");
			break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x430, %rsp            # imm = 0x430
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x403d18
movb 0xce748(%rip), %al      # 0x4d23b0
shrb $0x2, %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x403d0e
leaq -0x420(%rbp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x4010a0
movq -0x10(%rbp), %rdi
movl $0x2e, %esi
callq 0x401050
movq %rax, -0x428(%rbp)
cmpq $0x0, -0x428(%rbp)
je 0x403d04
leaq -0x420(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x428(%rbp), %rdx
movq -0x10(%rbp), %rax
subq %rax, %rdx
addq $0x1, %rdx
callq 0x401040
leaq -0x420(%rbp), %rdi
leaq 0x9b617(%rip), %rsi     # 0x49f2f2
callq 0x401058
leaq -0x420(%rbp), %rdi
movq -0x428(%rbp), %rsi
addq $0x1, %rsi
callq 0x401058
leaq -0x420(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x403d0c
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x403d16
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x403d18
movq -0x8(%rbp), %rdi
callq 0x401a20
movl %eax, -0x42c(%rbp)
movl -0x42c(%rbp), %eax
movl %eax, -0x430(%rbp)
subl $0x1, %eax
je 0x403d67
jmp 0x403d3a
movl -0x430(%rbp), %eax
subl $0x2, %eax
je 0x403d7a
jmp 0x403d47
movl -0x430(%rbp), %eax
subl $0x3, %eax
jne 0x403d8d
jmp 0x403d54
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x402720
jmp 0x403d9b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x402c30
jmp 0x403d9b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x4037e0
jmp 0x403d9b
leaq 0x9b54a(%rip), %rdi     # 0x49f2de
movb $0x0, %al
callq 0x40eab0
addq $0x430, %rsp            # imm = 0x430
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: renam
void renam(char* ipath, char* oname, char* nname) {
	int type = getFileType(ipath);
	switch(type) {
		case TYPE_TAP:
			tapRename(ipath, oname, nname);
			break;
		case TYPE_SCL:
			sclRename(ipath, oname, nname);
			break;
		case TYPE_TRD:
			trdRename(ipath, oname, nname);
			break;
		default:
			printf("Unknown image type\n");
			break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x401a20
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
subl $0x1, %eax
je 0x403e04
jmp 0x403ddd
movl -0x20(%rbp), %eax
subl $0x2, %eax
je 0x403e17
jmp 0x403de7
movl -0x20(%rbp), %eax
subl $0x3, %eax
jne 0x403e2a
jmp 0x403df1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x402750
jmp 0x403e38
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x402fb0
jmp 0x403e38
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x403a00
jmp 0x403e38
leaq 0x9b4ad(%rip), %rdi     # 0x49f2de
movb $0x0, %al
callq 0x40eab0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/group-function/command.c
// Function: usage
void usage(char **argv, char **av)
{
  if (av)
  {
    fprintf(stderr, "Unknown or invalid argument %s\n", av[0]);
  }
  fprintf(stderr, "Usage: %s <dest> <prio> <pgn> <field>=<value> ... | -version\n\n", argv[0]);
  fprintf(stderr, "       <field> is a decimal value\n");
  fprintf(stderr, "       <value> is a hexadecimal value; the length of the value defines how many bytes are encoded\n");
  fprintf(stderr, "       Maximum # of fields: %d\n\n", MAX_FIELDS);
  fprintf(stderr, "This program uses PGN 126208 to command a device to set fields to a particular value.\n");
  fprintf(stderr, "The use of this is thus completely dependent on what the device allows.\n\n" COPYRIGHT);
  exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x13c6
movq 0x5c4a(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x2c45(%rip), %rsi      # 0x4004
movb $0x0, %al
callq 0x1140
movq 0x5c2b(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
leaq 0x2c46(%rip), %rsi      # 0x4024
movb $0x0, %al
callq 0x1140
movq 0x5c0c(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x2c6d(%rip), %rsi      # 0x4063
movb $0x0, %al
callq 0x1140
movq 0x5bf4(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x2c78(%rip), %rsi      # 0x4086
movb $0x0, %al
callq 0x1140
movq 0x5bdc(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x2cc3(%rip), %rsi      # 0x40e9
movl $0x14, %edx
movb $0x0, %al
callq 0x1140
movq 0x5bbf(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x2cc7(%rip), %rsi      # 0x410a
movb $0x0, %al
callq 0x1140
movq 0x5ba7(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x2d06(%rip), %rsi      # 0x4161
movb $0x0, %al
callq 0x1140
movl $0x1, %edi
callq 0x1200
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_11/entab.c
// Function: main
int main(int argc, char *argv[])
{
  if (!is_tab_stop_arg_list_valid(argc, argv))
  {
    puts("Error: invalid tab stop list.\n");
    return EXIT_FAILURE;
  }

  int c;
  size_t arg_pos = 1;
  size_t line_pos = 0;
  size_t tab_stop = DEFAULT_TAB_LENGTH;
  size_t nr_of_spaces = 0;
  size_t nr_of_custom_tab_stops = argc - 1;

  while ((c = getchar()) != EOF)
  {
    ++line_pos;

    if (c == ' ')
    {
      ++nr_of_spaces;

      if (nr_of_custom_tab_stops)
      {
        tab_stop = atoi(argv[arg_pos]);
      }
      else if (argc > 1)
      {
        tab_stop = 1;
      }

      if (line_pos % tab_stop == 0 && nr_of_spaces > 1)
      {
        putchar('\t');

        if (nr_of_custom_tab_stops)
        {
          ++arg_pos;
          --nr_of_custom_tab_stops;
        }

        nr_of_spaces = 0;
      }
    }
    else
    {
      while (nr_of_spaces)
      {
        putchar(' ');
        --nr_of_spaces;
      }

      if (c == '\n')
      {
        arg_pos = 1;
        line_pos = 0;
        nr_of_custom_tab_stops = argc - 1;
      }

      putchar(c);
    }
  }

  return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x1310
cmpl $0x0, %eax
jne 0x11cf
leaq 0xe46(%rip), %rdi       # 0x2004
callq 0x1040
movl $0x1, -0x4(%rbp)
jmp 0x1301
movq $0x1, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x8, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movl -0x8(%rbp), %eax
subl $0x1, %eax
cltq
movq %rax, -0x40(%rbp)
callq 0x1060
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
je 0x12fa
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
cmpl $0x20, -0x14(%rbp)
jne 0x12aa
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x124e
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1070
cltq
movq %rax, -0x30(%rbp)
jmp 0x125e
cmpl $0x1, -0x8(%rbp)
jle 0x125c
movq $0x1, -0x30(%rbp)
jmp 0x125e
movq -0x28(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x30(%rbp)
cmpq $0x0, %rdx
jne 0x12a8
cmpq $0x1, -0x38(%rbp)
jbe 0x12a8
movl $0x9, %edi
callq 0x1030
cmpq $0x0, -0x40(%rbp)
je 0x12a0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
jmp 0x12f5
jmp 0x12ac
cmpq $0x0, -0x38(%rbp)
je 0x12cb
movl $0x20, %edi
callq 0x1030
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x12ac
cmpl $0xa, -0x14(%rbp)
jne 0x12ed
movq $0x1, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movl -0x8(%rbp), %eax
subl $0x1, %eax
cltq
movq %rax, -0x40(%rbp)
movl -0x14(%rbp), %edi
callq 0x1030
jmp 0x11fb
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_5/exercise_5_11/entab.c
// Function: is_tab_stop_arg_list_valid
int is_tab_stop_arg_list_valid(int argc, char *argv[])
{
  for (size_t i = 1; i < argc; ++i)
  {
    if (!is_str_uint(argv[i]) || (i > 1 && atoi(argv[i - 1]) > atoi(argv[i])))
    {
      return 0;
    }
  }
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x1, -0x18(%rbp)
movq -0x18(%rbp), %rax
movslq -0x8(%rbp), %rcx
cmpq %rcx, %rax
jae 0x139c
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x13b0
cmpl $0x0, %eax
je 0x1383
cmpq $0x1, -0x18(%rbp)
jbe 0x138c
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1070
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1070
movl %eax, %ecx
movl -0x1c(%rbp), %eax
cmpl %ecx, %eax
jle 0x138c
movl $0x0, -0x4(%rbp)
jmp 0x13a3
jmp 0x138e
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1327
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Aethlas[P]fflz4/fflz4.c
// Function: usage
static void usage(void)
{
    printf("Usage fflz4:\n");
    printf("-u\tSession urls\n");
    printf("-t\tSession titles\n");
    printf("-c\tActive title & url. Can be limited with -u or -t\n");
    printf("-b\tBookmarks title & url saved in toolbar. Can be limited with -u or -t\n");
    printf("-s\tRaw session json\n");
    printf("-d\tRaw bookmarks json\n");
    printf("-p\t(Optional) Provide path to firefox profile. Default: /home/<user>/.mozilla/firefox/<xxxxxx.default>/\n");
}

// Assembly:
pushq %rax
leaq 0x4bdc0(%rip), %rdi     # 0x4d2d8
movb $0x0, %al
callq 0x10b0
leaq 0x4bdc0(%rip), %rdi     # 0x4d2e6
movb $0x0, %al
callq 0x10b0
leaq 0x4bdc3(%rip), %rdi     # 0x4d2f7
movb $0x0, %al
callq 0x10b0
leaq 0x4bdc8(%rip), %rdi     # 0x4d30a
movb $0x0, %al
callq 0x10b0
leaq 0x4bdef(%rip), %rdi     # 0x4d33f
movb $0x0, %al
callq 0x10b0
leaq 0x4be2a(%rip), %rdi     # 0x4d388
movb $0x0, %al
callq 0x10b0
leaq 0x4be31(%rip), %rdi     # 0x4d39d
movb $0x0, %al
callq 0x10b0
leaq 0x4be3a(%rip), %rdi     # 0x4d3b4
movb $0x0, %al
callq 0x10b0
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Aethlas[P]fflz4/fflz4.c
// Function: get_tabs
void get_tabs(const char *path, const unsigned int flag)
{
    cJSON *json = NULL;
    char *buf = NULL, *result = NULL;
    int len = 0;

    len = path[strlen(path)-1] == '/' ? asprintf(&buf, "%s%s/%s", path, SESSION, TABS) : asprintf(&buf, "%s/%s/%s", path, SESSION, TABS);
    if (!len) FAILED(0, "Not enough memory\n");

    result = extract_jsonlz4(buf);
    if (!result) FAILED(0, "Failed to read jsonlz4 at: %s\n", buf);

    json = cJSON_Parse(result);
    if (!json) goto cleanup;

    if (flag & FLAG_S) {
        char *js = cJSON_Print(json);
        fprintf(stdout, "%s\n", js);
        free(js);
        goto cleanup;
    }

    const cJSON *windows = cJSON_GetObjectItemCaseSensitive(json, "windows");
    if (!cJSON_IsArray(windows)) goto cleanup;

    print_tabs(windows, flag);

cleanup:
    if (json) cJSON_Delete(json);
    free(buf);
    free(result);
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movl %esi, 0x4c(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rdi
callq 0x10a0
movq %rax, %rcx
movq 0x10(%rsp), %rax
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
jne 0x1895
movq 0x50(%rsp), %rdx
movq 0x4f8b3(%rip), %rcx     # 0x51128
movq 0x4f8b4(%rip), %r8      # 0x51130
leaq 0x38(%rsp), %rdi
leaq 0x4b99e(%rip), %rsi     # 0x4d226
movb $0x0, %al
callq 0x1190
movl %eax, 0xc(%rsp)
jmp 0x18bf
movq 0x50(%rsp), %rdx
movq 0x4f887(%rip), %rcx     # 0x51128
movq 0x4f888(%rip), %r8      # 0x51130
leaq 0x38(%rsp), %rdi
leaq 0x4b97a(%rip), %rsi     # 0x4d22e
movb $0x0, %al
callq 0x1190
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
jne 0x18f2
jmp 0x18d0
movq 0x4f721(%rip), %rax     # 0x50ff8
movq (%rax), %rdi
leaq 0x4b829(%rip), %rsi     # 0x4d10a
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x11f0
movq 0x38(%rsp), %rdi
callq 0x1ee0
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x1932
jmp 0x190b
movq 0x4f6e6(%rip), %rax     # 0x50ff8
movq (%rax), %rdi
movq 0x38(%rsp), %rdx
leaq 0x4b916(%rip), %rsi     # 0x4d237
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x11f0
movq 0x30(%rsp), %rdi
callq 0x47d70
movq %rax, 0x40(%rsp)
cmpq $0x0, 0x40(%rsp)
jne 0x194b
jmp 0x19c4
movl 0x4c(%rsp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x198f
movq 0x40(%rsp), %rdi
callq 0x47d90
movq %rax, 0x20(%rsp)
movq 0x4f64b(%rip), %rax     # 0x50fb8
movq (%rax), %rdi
movq 0x20(%rsp), %rdx
leaq 0x4b917(%rip), %rsi     # 0x4d293
movb $0x0, %al
callq 0x1100
movq 0x20(%rsp), %rdi
callq 0x1220
jmp 0x19c4
movq 0x40(%rsp), %rdi
leaq 0x4b8bb(%rip), %rsi     # 0x4d256
callq 0x48660
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
callq 0x4a3d0
cmpl $0x0, %eax
jne 0x19b6
jmp 0x19c4
movq 0x18(%rsp), %rdi
movl 0x4c(%rsp), %esi
callq 0x2190
cmpq $0x0, 0x40(%rsp)
je 0x19d6
movq 0x40(%rsp), %rdi
callq 0x47590
movq 0x38(%rsp), %rdi
callq 0x1220
movq 0x30(%rsp), %rdi
callq 0x1220
addq $0x58, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Aethlas[P]fflz4/fflz4.c
// Function: extract_jsonlz4
char *extract_jsonlz4(const char *path)
{
    size_t SIZE = 0;
    unsigned int dst_size;
    const int hdr_size = sizeof(unsigned int);
    char *source = NULL, *result = NULL;

    /* read file */
    /* skip "mozLz40\0" header */
    source = get_file_content(path, "rb", 8, &SIZE);

    memcpy(&dst_size, source, 4);
    if (dst_size > INT_MAX) FAILED(0, "Invalid size in header: 0x%x\n", dst_size);

    result = calloc(dst_size+1, sizeof(char));
    if (!result) FAILED(0, "Not enough memory\n");

    int osize = LZ4_decompress_safe(source + hdr_size, result, SIZE - hdr_size, dst_size);
    if (osize < 0) FAILED(0, "Corrupt input at byte %d\n", -osize);

    free(source);
    return result;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movl $0x4, 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x4b1d1(%rip), %rsi     # 0x4d0e9
movl $0x8, %edx
leaq 0x28(%rsp), %rcx
callq 0x2020
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x24(%rsp)
cmpl $0x7fffffff, 0x24(%rsp) # imm = 0x7FFFFFFF
jbe 0x1f69
jmp 0x1f43
movq 0x4f0ae(%rip), %rax     # 0x50ff8
movq (%rax), %rdi
movl 0x24(%rsp), %edx
leaq 0x4b194(%rip), %rsi     # 0x4d0ec
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x11f0
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x10e0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x1faf
jmp 0x1f8d
movq 0x4f064(%rip), %rax     # 0x50ff8
movq (%rax), %rdi
leaq 0x4b16c(%rip), %rsi     # 0x4d10a
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x11f0
movq 0x18(%rsp), %rdi
addq $0x4, %rdi
movq 0x10(%rsp), %rsi
movq 0x28(%rsp), %rax
subq $0x4, %rax
movl %eax, %edx
movl 0x24(%rsp), %ecx
callq 0x36200
movl %eax, 0xc(%rsp)
cmpl $0x0, 0xc(%rsp)
jge 0x2006
jmp 0x1fde
movq 0x4f013(%rip), %rax     # 0x50ff8
movq (%rax), %rdi
xorl %edx, %edx
subl 0xc(%rsp), %edx
leaq 0x4b128(%rip), %rsi     # 0x4d11d
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x11f0
movq 0x18(%rsp), %rdi
callq 0x1220
movq 0x10(%rsp), %rax
addq $0x38, %rsp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Aethlas[P]fflz4/fflz4.c
// Function: get_file_content
char *get_file_content(const char *path, const char *rw, const size_t offset, size_t *size)
{
    FILE *fptr;
    size_t SIZE = 0, sz = 0;
    char *result = NULL;

    fptr = fopen(path, rw);
    if (!fptr) FAILED(0, "File not found at: %s", path);

    fseek(fptr, 0, SEEK_END);
    SIZE = ftell(fptr);
    fseek(fptr, offset, SEEK_SET);
    SIZE -= offset;

    result = calloc(SIZE+1, sizeof(char));
    if (!result) FAILED(0, "Not enough memory\n");

    sz = fread(result, 1, SIZE, fptr);
    if (sz != SIZE) FAILED(0, "File reading failed\n");

    fclose(fptr);

    *size = SIZE;
    return result;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x11b0
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x2098
jmp 0x2071
movq 0x4ef80(%rip), %rax     # 0x50ff8
movq (%rax), %rdi
movq 0x40(%rsp), %rdx
leaq 0x4b174(%rip), %rsi     # 0x4d1fb
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x11f0
movq 0x20(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x2, %edx
callq 0x1180
movq 0x20(%rsp), %rdi
callq 0x1110
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %rsi
xorl %edx, %edx
callq 0x1180
movq 0x30(%rsp), %rcx
movq 0x18(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
addq $0x1, %rdi
movl $0x1, %esi
callq 0x10e0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x2121
jmp 0x20ff
movq 0x4eef2(%rip), %rax     # 0x50ff8
movq (%rax), %rdi
leaq 0x4affa(%rip), %rsi     # 0x4d10a
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x11f0
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
movl $0x1, %esi
callq 0x1060
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x18(%rsp), %rax
je 0x216f
jmp 0x214d
movq 0x4eea4(%rip), %rax     # 0x50ff8
movq (%rax), %rdi
leaq 0x4b0b3(%rip), %rsi     # 0x4d211
movb $0x0, %al
callq 0x1100
movl $0x1, %edi
callq 0x11f0
movq 0x20(%rsp), %rdi
callq 0x1080
movq 0x18(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
movq 0x8(%rsp), %rax
addq $0x48, %rsp
retq