LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/lemire[P]simdprune/benchmark.c
// Function: print_epi8
void print_epi8(__m128i x) {
  uint8_t buffer[16];
  _mm_storeu_si128((__m128i*)buffer,x);
  for(size_t i = 0; i < 16; i++) {
    printf("%u ", buffer[i]);
  }
  printf("\n");
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
vmovaps %xmm0, (%rsp)
leaq 0x10579a(%rip), %rbx    # 0x106ba0
xorl %r14d, %r14d
movzbl (%rsp,%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1060
incq %r14
cmpq $0x10, %r14
jne 0x1409
movl $0xa, %edi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O1/lemire[P]simdprune/benchmark.c
// Function: check_prune_epi8
void check_prune_epi8(__m128i input, __m128i output, int mask) {
  uint8_t buffer[16];
  _mm_storeu_si128((__m128i*)buffer,input);
  size_t pos = 0;
  uint8_t outbuffer[16];
  _mm_storeu_si128((__m128i*)outbuffer,output);

  for(size_t i = 0; i < 16; i++) {
    if((mask & (1<<i)) == 0) {
      assert(buffer[i] == outbuffer[pos]);
      pos ++;
    }
  }
}

// Assembly:
subq $0x28, %rsp
vmovaps %xmm0, 0x10(%rsp)
vmovaps %xmm1, (%rsp)
xorl %eax, %eax
xorl %ecx, %ecx
btl %eax, %edi
jb 0x1456
movb 0x10(%rsp,%rax), %dl
cmpb (%rsp,%rcx), %dl
jne 0x1464
incq %rcx
incq %rax
cmpq $0x10, %rax
jne 0x1445
addq $0x28, %rsp
retq
leaq 0x105739(%rip), %rdi    # 0x106ba4
leaq 0x10574e(%rip), %rsi    # 0x106bc0
leaq 0x105753(%rip), %rcx    # 0x106bcc
movl $0xe8, %edx
callq 0x1070
// File: /workspace/github_c_makefile_star2_O1/lemire[P]simdprune/benchmark.c
// Function: testepi8
void testepi8() {
  for(int mask = 0; mask < (1<<16); mask++) {
    __m128i source = _mm_set_epi8(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
    __m128i m1 = prune_epi8(source, mask);
    check_prune_epi8(source, m1, mask);
    __m128i m2 = thinprune_epi8(source, mask);
    check_prune_epi8(source, m2, mask);
    __m128i m3 = skinnyprune_epi8(source, mask);
    check_prune_epi8(source, m3, mask);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x1b88(%rip), %r14      # 0x3020
xorl %ebx, %ebx
leaq 0x101b7f(%rip), %r15    # 0x103020
leaq 0x102478(%rip), %r13    # 0x103920
vmovdqa 0x105690(%rip), %xmm0   # 0x106b40
vpshufb (%r14), %xmm0, %xmm1
movl %ebx, %edi
callq 0x1432
movzbl %bl, %eax
popcntl %eax, %eax
movzbl %bl, %ebp
movl %ebp, %ecx
movl %ebx, %r12d
shrl $0x8, %r12d
vmovq (%r15,%r12,8), %xmm0
vpbroadcastb 0x1b33(%rip), %xmm1 # 0x3011
vpaddb %xmm1, %xmm0, %xmm0
shll $0x3, %eax
movl $0x40, %edx
subl %eax, %edx
vmovd %edx, %xmm1
vpsllq %xmm1, %xmm0, %xmm1
vpslldq $0x8, %xmm0, %xmm0      # xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0,1,2,3,4,5,6,7]
vmovd %eax, %xmm2
vpsrlq %xmm2, %xmm0, %xmm2
vmovq (%r15,%rcx,8), %xmm0
vmovdqa %xmm0, (%rsp)
vpternlogq $0xfe, %xmm0, %xmm1, %xmm2
vmovdqa 0x105625(%rip), %xmm0   # 0x106b40
vpshufb %xmm2, %xmm0, %xmm1
movl %ebx, %edi
callq 0x1432
vmovaps (%rsp), %xmm0
vmovhps (%r15,%r12,8), %xmm0, %xmm0 # xmm0 = xmm0[0,1],mem[0,1]
vpaddb 0x1055f6(%rip), %xmm0, %xmm1 # 0x106b30
vmovdqa 0x1055fe(%rip), %xmm0   # 0x106b40
vpshufb %xmm1, %xmm0, %xmm1
leaq 0x1022d2(%rip), %rax    # 0x103820
movzbl (%rbp,%rax), %eax
vpshufb (%r13,%rax,8), %xmm1, %xmm1
movl %ebx, %edi
callq 0x1432
incq %rbx
addq $0x10, %r14
cmpq $0x10000, %rbx          # imm = 0x10000
jne 0x14a8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: readfile
int readfile(char* path, char* buf, int maxlen) {
	FILE *infile = fopen(path,"rb");
	if (!infile) {
		printf("Can't open file '%s'\n",path);
		return -1;		// failed to open file
	}
	fseek(infile, 0, SEEK_END);
	int iflen = ftell(infile);
	rewind(infile);
	if (iflen <= maxlen) {
		fread(buf, iflen, 1, infile);
	} else {
		printf("File '%s' is too long (max is 0x%X bytes)\n", path, maxlen);
		iflen = -2;
	}
	fclose(infile);
	return iflen;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %r14
leaq 0x9d7eb(%rip), %rsi     # 0x49f051
callq 0x4148a0
testq %rax, %rax
je 0x4018b6
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x418af0
movq %rbx, %rdi
callq 0x414aa0
movq %rax, %r13
movq %rbx, %rdi
callq 0x418cf0
cmpl %r12d, %r13d
jle 0x4018cf
leaq 0x9d7c9(%rip), %rdi     # 0x49f06a
movq %r14, %rsi
movl %r12d, %edx
xorl %eax, %eax
callq 0x40de40
movl $0xfffffffe, %r13d      # imm = 0xFFFFFFFE
jmp 0x4018e2
leaq 0x9d797(%rip), %rdi     # 0x49f054
movq %r14, %rsi
xorl %eax, %eax
callq 0x40de40
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jmp 0x4018ea
movslq %r13d, %rsi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x4149a0
movq %rbx, %rdi
callq 0x414460
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: savefile
int savefile(char* path, char* buf, int len) {
	FILE *file = fopen(path, "wb");
	if (!file) {
		printf("Can't open file '%s' for writing\n",path);
		return 0;
	}
	if (buf && (len > 0)) fwrite(buf, len, 1, file);
	fclose(file);
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x9d77e(%rip), %rsi     # 0x49f095
callq 0x4148a0
testq %rax, %rax
je 0x401956
movq %rax, %r14
testq %rbx, %rbx
sete %al
testl %r15d, %r15d
setle %cl
orb %al, %cl
jne 0x401947
movl %r15d, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rcx
callq 0x414bf0
movq %r14, %rdi
callq 0x414460
movl $0x1, %ebx
jmp 0x401969
leaq 0x9d73b(%rip), %rdi     # 0x49f098
xorl %ebx, %ebx
movq %r12, %rsi
xorl %eax, %eax
callq 0x40de40
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: testExt
int testExt(char* path, char* ext) {
	char* ptr = strrchr(path, '.');
	if (!ptr) return 0;
	char buf[255];
	strcpy(buf, ptr + 1);
	ptr = buf;
	while (*ptr) {
		*ptr = tolower(*ptr);
		ptr++;
	}
	if (strcmp(ext, buf)) return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rsi, %rbx
movl $0x2e, %esi
callq 0x401050
testq %rax, %rax
je 0x4019ef
incq %rax
leaq -0x110(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x401020
movb (%r14), %r14b
testb %r14b, %r14b
je 0x4019d5
callq 0x4066b0
leaq -0x10f(%rbp), %rcx
movq (%rax), %rdx
movsbq %r14b, %rsi
movb (%rdx,%rsi,4), %dl
movb %dl, -0x1(%rcx)
movb (%rcx), %r14b
incq %rcx
testb %r14b, %r14b
jne 0x4019bd
leaq -0x110(%rbp), %rsi
movq %rbx, %rdi
callq 0x4010b0
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
sete %al
jmp 0x4019f1
xorl %eax, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: getFileType
int getFileType(char* path) {
	FILE* file = fopen(path, "rb");
	char buf[9];
	int res = TYPE_UNKNOWN;
	if (testExt(path, "tap")) {
		res = TYPE_TAP;
	} else if (testExt(path, "scl") && file) {
		fread(buf, 9, 1, file);
		if ((strncmp(buf, "SINCLAIR", 8) == 0) && ((unsigned)buf[8] < 129))
			res = TYPE_SCL;
	} else if (testExt(path, "trd") && file) {
		fseek(file, 0, SEEK_END);
		size_t size = ftell(file);
		fseek(file, 0x8e7, SEEK_SET);
		int type = fgetc(file);
		if ((size > 0x8ff) && (size < 0xa0001) && (type == 0x10))
			res = TYPE_TRD;
	}
	if (file) fclose(file);
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x9d63d(%rip), %rsi     # 0x49f051
callq 0x4148a0
movq %rax, %rbx
leaq 0x9d697(%rip), %rsi     # 0x49f0ba
movq %r14, %rdi
callq 0x401974
movl $0x3, %r15d
testl %eax, %eax
jne 0x401af6
leaq 0x9d67e(%rip), %rsi     # 0x49f0be
movq %r14, %rdi
callq 0x401974
testq %rbx, %rbx
je 0x401a8a
testl %eax, %eax
je 0x401a8a
leaq -0x21(%rbp), %r14
movl $0x9, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x4149a0
movabsq $0x5249414c434e4953, %rax # imm = 0x5249414C434E4953
cmpq %rax, (%r14)
sete %al
cmpb $0x0, 0x8(%r14)
setns %cl
andb %al, %cl
movzbl %cl, %r15d
jmp 0x401af6
leaq 0x9d63a(%rip), %rsi     # 0x49f0cb
movq %r14, %rdi
callq 0x401974
xorl %r15d, %r15d
testq %rbx, %rbx
je 0x401af6
testl %eax, %eax
je 0x401af6
movq %rbx, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x418af0
movq %rbx, %rdi
callq 0x414aa0
movq %rax, %r14
movl $0x8e7, %esi            # imm = 0x8E7
movq %rbx, %rdi
xorl %edx, %edx
callq 0x418af0
movq %rbx, %rdi
callq 0x418bd0
addq $-0x900, %r14           # imm = 0xF700
cmpq $0x9f701, %r14          # imm = 0x9F701
setb %cl
cmpl $0x10, %eax
sete %al
andb %cl, %al
movzbl %al, %r15d
addl %r15d, %r15d
testq %rbx, %rbx
je 0x401b03
movq %rbx, %rdi
callq 0x414460
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: cutName
xName cutName(char* path) {
	char fnam[strlen(path) + 1];
	char* ptr = strrchr(path, SLASH);		// last slash
	if (ptr) {
		strcpy(fnam, ptr + 1);
	} else {
		strcpy(fnam, path);
	}
	ptr = strrchr(fnam, '.');
	xName nm;
	memset(nm.name, 0x20, 10);
	memset(nm.ext, 0x20, 3);
	if (ptr) {
		*ptr = 0x00;
		memcpy(nm.ext, ptr + 1, (strlen(ptr + 1) > 3) ? 3 : strlen(ptr + 1));
	}
	memcpy(nm.name, fnam, (strlen(fnam) > 10) ? 10 : strlen(fnam));
	return nm;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
callq 0x4010d8
movq %rsp, %rbx
addq $0x10, %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
movq %r14, %rdi
movl $0x2f, %esi
callq 0x401050
leaq 0x1(%rax), %rsi
testq %rax, %rax
cmoveq %r14, %rsi
movq %rbx, %rdi
callq 0x401020
movq %rbx, %rdi
movl $0x2e, %esi
callq 0x401050
movq %rax, %r14
movabsq $0x2020202020202020, %rax # imm = 0x2020202020202020
movq %rax, -0x20(%rbp)
movq %rax, -0x1b(%rbp)
testq %r14, %r14
je 0x401ba4
movb $0x0, (%r14)
incq %r14
movq %r14, %rdi
callq 0x4010d8
cmpq $0x3, %rax
movl $0x3, %edx
cmovbq %rax, %rdx
leaq -0x16(%rbp), %rdi
movq %r14, %rsi
callq 0x401040
movq %rbx, %rdi
callq 0x4010d8
cmpq $0xa, %rax
movl $0xa, %edx
cmovbq %rax, %rdx
leaq -0x20(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x401040
movq (%r14), %rax
movl 0x8(%r14), %ecx
movl 0xc(%r14), %edx
shlq $0x20, %rdx
orq %rcx, %rdx
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: stdAccumulate
int stdAccumulate(unsigned char* ptr, int size, int res) {
	while (size > 0) {
		res += *ptr;
		ptr++;
		size--;
	}
	return res;
}

// Assembly:
movl %edx, %eax
testl %esi, %esi
jle 0x401bff
pushq %rbp
movq %rsp, %rbp
incl %esi
movzbl (%rdi), %ecx
addl %ecx, %eax
incq %rdi
decl %esi
cmpl $0x1, %esi
jg 0x401bef
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: fgeti
int fgeti(FILE* file) {
	int res = fgetc(file) & 0xff;
	res |= (fgetc(file) << 8);
	res |= (fgetc(file) << 16);
	res |= (fgetc(file) << 24);
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x418bd0
movzbl %al, %r15d
movq %rbx, %rdi
callq 0x418bd0
movl %eax, %r14d
shll $0x8, %r14d
orl %r15d, %r14d
movq %rbx, %rdi
callq 0x418bd0
movl %eax, %r15d
shll $0x10, %r15d
movq %rbx, %rdi
callq 0x418bd0
shll $0x18, %eax
orl %r15d, %eax
orl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: fputi
void fputi(FILE* file, int val) {
	fputc(val & 0xff, file);
	fputc((val >> 8) & 0xff, file);
	fputc((val >> 16) & 0xff, file);
	fputc((val >> 24) & 0xff, file);	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movl $0xff, %r15d
movl %esi, %edi
andl %r15d, %edi
movq %rbx, %rsi
callq 0x4189b0
movl %r14d, %edi
shrl $0x8, %edi
andl %r15d, %edi
movq %rbx, %rsi
callq 0x4189b0
movl %r14d, %edi
shrl $0x10, %edi
andl %r15d, %edi
movq %rbx, %rsi
callq 0x4189b0
shrl $0x18, %r14d
movl %r14d, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4189b0
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: makeName
void makeName(char* name, char* buf) {
	if (name == NULL) return;
	memset(buf, 0x20, 9);
	char* ptr = strrchr(name, '.');
	if (ptr) {
		memcpy(buf, name, ((ptr - name) > 8) ? 8 : (ptr - name));
		ptr++;
		if (*ptr) buf[8] = *ptr;
	} else {
		memcpy(buf, name, (strlen(name) > 8) ? 8 : strlen(name));
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x401d0f
movq %rsi, %rbx
movq %rdi, %r14
movabsq $0x2020202020202020, %rax # imm = 0x2020202020202020
movq %rax, (%rsi)
movb $0x20, 0x8(%rsi)
movl $0x2e, %esi
callq 0x401050
testq %rax, %rax
je 0x401d1a
movq %rax, %r15
subq %r14, %rax
cmpq $0x8, %rax
movl $0x8, %edx
cmovlq %rax, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x401040
movb 0x1(%r15), %al
testb %al, %al
je 0x401d0f
movb %al, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x4010d8
cmpq $0x8, %rax
movl $0x8, %edx
cmovbq %rax, %rdx
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x401040
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: getSum
int getSum(char* data, int len) {
	unsigned int crc = 0;
	while (len--) {
		crc += (unsigned char)*data;
		data++;
	}
	return crc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %esi, %esi
je 0x401d61
movl %esi, %ecx
xorl %edx, %edx
xorl %eax, %eax
movzbl (%rdi,%rdx), %esi
addl %esi, %eax
incq %rdx
cmpl %edx, %ecx
jne 0x401d52
jmp 0x401d63
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: makeDSC
trdFile makeDSC(char* path, int len) {
	trdFile hd;
	xName nm = cutName(path);
	memcpy(hd.name, nm.name, 8);
	hd.lnl = len & 0xff;
	hd.lnh = (len >> 8) & 0xff;
	if (opt.isBasic) {
		hd.ext = 'B';
		hd.stl = hd.lnl;
		hd.sth = hd.lnh;
		len += 4;		// 80,AA,<AS.line>
	} else {
		hd.ext = nm.ext[0];
		hd.stl = nm.ext[1];
		hd.sth = nm.ext[2];
	}
	hd.slen = ((len >> 8) & 0xff) + ((len & 0xff) ? 1 : 0);
	return hd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
callq 0x401b11
movl %ebx, %esi
shrl $0x8, %esi
testb $0x1, 0xd0632(%rip)     # 0x4d23b0
jne 0x401da3
movabsq $0xffffffffff, %rcx     # imm = 0xFFFFFFFFFF
andq %rdx, %rcx
shrl $0x10, %edx
movq %rcx, %rdi
shrq $0x18, %rdi
shrq $0x20, %rcx
movzbl %dl, %r8d
movl %ebx, %edx
jmp 0x401db0
movl %ebx, %edi
movl %esi, %ecx
leal 0x4(%rbx), %edx
movl $0x42, %r8d
movl %edx, %r9d
shrl $0x8, %r9d
xorl %r10d, %r10d
testb %dl, %dl
setne %r10b
addl %r9d, %r10d
movl $0xff, %edx
andl %edx, %r10d
shlq $0x28, %r10
andl %edx, %esi
shlq $0x20, %rsi
orq %r10, %rsi
shll $0x18, %ebx
orq %rsi, %rbx
andl %edx, %ecx
shll $0x10, %ecx
orq %rbx, %rcx
shll $0x8, %edi
movzwl %di, %edx
orq %rcx, %rdx
orq %r8, %rdx
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: prepareFile
trdFile prepareFile(char* path, char* buf) {
	memset(buf, 0x00, 0x10000);
	trdFile hd;
	int ilen;
	memset(hd.name, 0x00, sizeof(trdFile));
	if (opt.asHobeta) {
		ilen = readfile(path, buf, 0xff11);	// +17 bytes header
		if (ilen > 0) {
			if (!buf[13])
				buf[13] = buf[14];
			memcpy((char*)&hd, buf, 15);
			memcpy(buf, buf+17, ilen-17);
		}
	} else {
		ilen = readfile(path, buf, 0xff00);
		if (ilen > 0) {
			if (opt.isBasic) {
				buf[ilen] = 0x80;
				buf[ilen+1] = 0xaa;
				buf[ilen+2] = opt.aStart & 0xff;
				buf[ilen+3] = (opt.aStart >> 8) & 0xff;
			}
			hd = makeDSC(path, ilen);
		}
	}
	return hd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x10000, %edx          # imm = 0x10000
movq %rsi, %rdi
xorl %esi, %esi
callq 0x4010a0
testb $0x4, 0xd0591(%rip)     # 0x4d23b0
jne 0x401e70
movq %r14, %rdi
movq %rbx, %rsi
movl $0xff00, %edx           # imm = 0xFF00
callq 0x401848
testl %eax, %eax
jle 0x401ebf
testb $0x1, 0xd0570(%rip)     # 0x4d23b0
je 0x401e5e
movl %eax, %ecx
movw $0xaa80, (%rbx,%rcx)    # imm = 0xAA80
movb 0xd0564(%rip), %dl      # 0x4d23b4
movb %dl, 0x2(%rbx,%rcx)
movb 0xd055b(%rip), %dl      # 0x4d23b5
movb %dl, 0x3(%rbx,%rcx)
movq %r14, %rdi
movl %eax, %esi
callq 0x401d65
movq %rax, %r14
movq %rdx, %r15
jmp 0x401ec5
movq %r14, %rdi
movq %rbx, %rsi
movl $0xff11, %edx           # imm = 0xFF11
callq 0x401848
testl %eax, %eax
jle 0x401ebf
cmpb $0x0, 0xd(%rbx)
jne 0x401e90
movb 0xe(%rbx), %cl
movb %cl, 0xd(%rbx)
movq (%rbx), %r14
movzwl 0xc(%rbx), %ecx
movzbl 0xe(%rbx), %edx
shll $0x10, %edx
orl %ecx, %edx
shlq $0x20, %rdx
movl 0x8(%rbx), %r15d
orq %rdx, %r15
leaq 0x11(%rbx), %rsi
addl $-0x11, %eax
movslq %eax, %rdx
movq %rbx, %rdi
callq 0x401040
jmp 0x401ec5
xorl %r15d, %r15d
xorl %r14d, %r14d
movq %r14, %rax
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
subq $0x10010, %rsp          # imm = 0x10010
movq %rdi, %rbx
movq %rcx, %rax
shrq $0x20, %rax
movl $0xff, %r8d
movl %eax, %r14d
andl %r8d, %r14d
cmpl $0x1000000, %ecx        # imm = 0x1000000
movl %r14d, %r9d
sbbl $-0x1, %r9d
movq %rcx, %rdi
shrq $0x28, %rdi
andl %edi, %r8d
cmpl %r8d, %r9d
jne 0x401f1d
shldl $0x8, %ecx, %r14d
jmp 0x401f24
shll $0x8, %r8d
movl %r8d, %r14d
testb $0x4, 0xd0485(%rip)     # 0x4d23b0
jne 0x401f43
movq %rbx, %rdi
movl %r14d, %edx
addq $0x10010, %rsp          # imm = 0x10010
popq %rbx
popq %r14
popq %rbp
jmp 0x4018fc
movq %rdx, -0x10020(%rbp)
movl %ecx, -0x10018(%rbp)
movb %al, -0x10014(%rbp)
movb $0x0, -0x10013(%rbp)
movb %dil, -0x10012(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
movzbl -0x10020(%rbp,%rcx), %edx
addl %edx, %eax
incq %rcx
cmpq $0xf, %rcx
jne 0x401f68
movl %eax, %ecx
shll $0x8, %ecx
addl %ecx, %eax
addl $0x69, %eax
leaq -0x1000f(%rbp), %rdi
movw %ax, -0x2(%rdi)
movl %r14d, %edx
callq 0x401040
addl $0x11, %r14d
leaq -0x10020(%rbp), %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x4018fc
addq $0x10010, %rsp          # imm = 0x10010
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %rbx
movl %ecx, -0x2c(%rbp)
movzbl %cl, %r14d
testl %esi, %esi
jle 0x401ff1
movl %r12d, %eax
xorl %ecx, %ecx
movsbl (%r15,%rcx), %edx
xorl %edx, %r14d
incq %rcx
cmpq %rcx, %rax
jne 0x401fe1
leal 0x2(%r12), %r13d
movl $0xff, %eax
movl %r13d, %edi
andl %eax, %edi
movq %rbx, %rsi
callq 0x4189b0
shrl $0x8, %r13d
movl $0xff, %eax
andl %eax, %r13d
movl %r13d, %edi
movq %rbx, %rsi
callq 0x4189b0
movl -0x2c(%rbp), %edi
movq %rbx, %rsi
callq 0x4189b0
movslq %r12d, %rsi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x414bf0
movl %r14d, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4189b0
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x9cfd2(%rip), %rsi     # 0x49f051
callq 0x4148a0
testq %rax, %rax
je 0x4021ab
movq %rax, %rbx
leaq 0x9d3e6(%rip), %rdi     # 0x49f47d
callq 0x414ec0
leaq 0x9d3f0(%rip), %rdi     # 0x49f493
callq 0x414ec0
movq %rbx, %rdi
callq 0x418bd0
movl %eax, %r14d
movq %rbx, %rdi
callq 0x418bd0
movl %eax, %r15d
movq %rbx, %rdi
callq 0x4188e0
testl %eax, %eax
jne 0x402194
shll $0x8, %r15d
orl %r14d, %r15d
leaq 0x9d025(%rip), %r13     # 0x49f101
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x418bd0
testl %eax, %eax
je 0x402115
leal -0x1(%r15), %eax
movslq %eax, %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x418af0
addl $-0x2, %r15d
movq %r13, %rdi
movl %r14d, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x40de40
jmp 0x402164
movl $0x11, %esi
movl $0x1, %edx
leaq -0x39(%rbp), %rdi
movq %rbx, %rcx
callq 0x4149a0
cmpb $0x0, -0x39(%rbp)
leaq 0x9cfc0(%rip), %rdx     # 0x49f0f6
leaq 0x9cfbf(%rip), %rax     # 0x49f0fc
cmoveq %rax, %rdx
movzwl -0x2c(%rbp), %ecx
movzwl -0x2e(%rbp), %r8d
leaq 0x9cf95(%rip), %rdi     # 0x49f0e6
leaq -0x38(%rbp), %rsi
xorl %eax, %eax
callq 0x40de40
movq %rbx, %rdi
callq 0x418bd0
incl %r14d
movq %rbx, %rdi
callq 0x418bd0
movl %eax, %r12d
movq %rbx, %rdi
callq 0x418bd0
movl %eax, %r15d
shll $0x8, %r15d
orl %r12d, %r15d
movq %rbx, %rdi
callq 0x4188e0
testl %eax, %eax
je 0x4020df
movq %rbx, %rdi
callq 0x414460
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9cf1d(%rip), %rdi     # 0x49f0cf
movq %r14, %rsi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x40de40
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10020, %rsp          # imm = 0x10020
movq %rsi, %r15
movq %rdi, %r12
leaq -0x10040(%rbp), %rsi
movq %r15, %rdi
movl $0xfffd, %edx           # imm = 0xFFFD
callq 0x401848
testl %eax, %eax
js 0x402268
movl %eax, %ebx
leaq 0x9cf0e(%rip), %rsi     # 0x49f111
movq %r12, %rdi
callq 0x4148a0
testq %rax, %rax
je 0x402278
movq %rax, %r14
testb $0x2, 0xd0196(%rip)     # 0x4d23b0
jne 0x4022c7
movabsq $0x2020202020202020, %rax # imm = 0x2020202020202020
movq %rax, -0x30(%rbp)
movw $0x2020, -0x28(%rbp)    # imm = 0x2020
movq %r15, %rdi
callq 0x401b11
movq %rax, -0x30(%rbp)
movw %dx, -0x28(%rbp)
movb %bl, -0x26(%rbp)
movl %ebx, %eax
shrl $0x8, %eax
movb %al, -0x25(%rbp)
testb $0x1, 0xd015a(%rip)     # 0x4d23b0
jne 0x402298
movb $0x3, -0x31(%rbp)
movb $0x0, -0x24(%rbp)
movb $-0x80, %al
xorl %ecx, %ecx
xorl %esi, %esi
jmp 0x4022aa
addq $0x10020, %rsp          # imm = 0x10020
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9ce95(%rip), %rdi     # 0x49f114
movq %r12, %rsi
xorl %eax, %eax
addq $0x10020, %rsp          # imm = 0x10020
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x40de40
movb $0x0, -0x31(%rbp)
movl 0xd0112(%rip), %ecx     # 0x4d23b4
movb %cl, -0x24(%rbp)
shrl $0x8, %ecx
movl %ebx, %esi
leaq -0x31(%rbp), %rdx
movb %cl, 0xe(%rdx)
movb %sil, 0xf(%rdx)
movb %al, 0x10(%rdx)
movq %r14, %rdi
movl $0x11, %esi
xorl %ecx, %ecx
callq 0x401fba
leaq -0x10040(%rbp), %rdx
movq %r14, %rdi
movl %ebx, %esi
movl $0xff, %ecx
callq 0x401fba
movq %r14, %rdi
addq $0x10020, %rsp          # imm = 0x10020
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x414460
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
leaq 0x9cceb(%rip), %rsi     # 0x49f051
callq 0x4148a0
testq %rax, %rax
je 0x402401
movq %rax, %rbx
leaq 0x9d14c(%rip), %rdi     # 0x49f4ca
callq 0x414ec0
movl $0x8, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x418af0
movq %rbx, %rdi
callq 0x418bd0
testl %eax, %eax
jle 0x4023ec
movl %eax, %r14d
incl %r14d
leaq -0x30(%rbp), %r15
leaq 0x9cd81(%rip), %r12     # 0x49f130
movl $0xe, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x4149a0
movzwl -0x27(%rbp), %ecx
movzwl -0x25(%rbp), %r8d
movsbl -0x28(%rbp), %edx
movzbl -0x23(%rbp), %r9d
movq %r12, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x40de40
decl %r14d
cmpl $0x1, %r14d
jg 0x4023af
movq %rbx, %rdi
callq 0x414460
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9ccc7(%rip), %rdi     # 0x49f0cf
movq %r14, %rsi
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x40de40
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
movl $0x8, %esi
xorl %edx, %edx
callq 0x418af0
movq %r15, -0x30(%rbp)
movq %r15, %rdi
callq 0x418bd0
testl %eax, %eax
jle 0x4029ac
movl %eax, %r12d
movl $0x9, %ecx
movl %ecx, %r15d
movl $0xe, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq -0x30(%rbp), %rcx
callq 0x4149a0
movq (%rbx), %rax
xorq (%r14), %rax
movb 0x8(%rbx), %cl
xorb 0x8(%r14), %cl
movzbl %cl, %edx
leal 0xe(%r15), %ecx
xorl %esi, %esi
orq %rax, %rdx
setne %sil
movl $0x1, %eax
cmovel %eax, %r13d
cmovel %r15d, %ecx
subl %esi, %r12d
testl %r12d, %r12d
jle 0x4029a0
testl %r13d, %r13d
je 0x402950
xorl %eax, %eax
cmpl $0x1, %r13d
sbbl %eax, %eax
orl %ecx, %eax
jmp 0x4029b1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq 0x9c7b1(%rip), %rsi     # 0x49f190
callq 0x4148a0
testq %rax, %rax
je 0x402ab5
movq %rax, %rbx
leaq -0x29(%rbp), %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x401cb1
leaq -0x39(%rbp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x402912
testl %eax, %eax
js 0x402ad2
movl %eax, %r15d
xorl %eax, %eax
xorl %r12d, %r12d
movzbl -0x29(%rbp,%rax), %ecx
addl %ecx, %r12d
incq %rax
cmpl $0x9, %eax
jne 0x402a1e
leaq -0x29(%rbp), %rsi
movq %r14, %rdi
callq 0x401cb1
xorl %eax, %eax
xorl %r14d, %r14d
movzbl -0x29(%rbp,%rax), %ecx
addl %ecx, %r14d
incq %rax
cmpl $0x9, %eax
jne 0x402a3f
subl %r12d, %r14d
movl %r15d, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x418af0
leaq -0x29(%rbp), %rdi
movl $0x9, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x414bf0
movq %rbx, %rdi
movq $-0x4, %rsi
movl $0x2, %edx
callq 0x418af0
movq %rbx, %rdi
callq 0x401c00
addl %eax, %r14d
movq %rbx, %rdi
movq $-0x4, %rsi
movl $0x2, %edx
callq 0x418af0
movq %rbx, %rdi
movl %r14d, %esi
callq 0x401c53
jmp 0x402ae3
leaq 0x9c598(%rip), %rdi     # 0x49f054
movq %r15, %rsi
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x40de40
leaq 0x9c699(%rip), %rdi     # 0x49f172
movq %r12, %rsi
xorl %eax, %eax
callq 0x40de40
movq %rbx, %rdi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x414460
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
subq $0xa0000, %rsp          # imm = 0xA0000
movq %rdi, %rbx
leaq -0xa0010(%rbp), %r14
movl $0xa0000, %edx          # imm = 0xA0000
movq %r14, %rdi
xorl %esi, %esi
callq 0x4010a0
movw $0x1601, 0x8e2(%r14)    # imm = 0x1601
movw $0x9f0, 0x8e5(%r14)     # imm = 0x9F0
movb $0x10, 0x8e7(%r14)
leaq 0x9c554(%rip), %rsi     # 0x49f095
movq %rbx, %rdi
callq 0x4148a0
testq %rax, %rax
je 0x402b7d
movq %rax, %r14
leaq -0xa0010(%rbp), %rdi
movl $0xa0000, %esi          # imm = 0xA0000
movl $0x1, %edx
movq %rax, %rcx
callq 0x414bf0
movq %r14, %rdi
addq $0xa0000, %rsp          # imm = 0xA0000
popq %rbx
popq %r14
popq %rbp
jmp 0x414460
leaq 0x9c60f(%rip), %rdi     # 0x49f193
movq %rbx, %rsi
xorl %eax, %eax
addq $0xa0000, %rsp          # imm = 0xA0000
popq %rbx
popq %r14
popq %rbp
jmp 0x40de40
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
leaq 0x9c4a1(%rip), %rsi     # 0x49f051
callq 0x4148a0
testq %rax, %rax
je 0x402c40
movq %rax, %rbx
leaq 0x9c950(%rip), %rdi     # 0x49f518
callq 0x414ec0
leaq -0x28(%rbp), %r14
leaq 0x9c5d5(%rip), %r15     # 0x49f1ad
movl $0x10, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x4149a0
movzbl -0x28(%rbp), %eax
cmpl $0x1, %eax
je 0x402bd8
testl %eax, %eax
je 0x402c2d
movzwl -0x1f(%rbp), %ecx
movzwl -0x1d(%rbp), %r8d
movsbl -0x20(%rbp), %edx
movzbl -0x1b(%rbp), %r9d
movzbl -0x1a(%rbp), %r10d
movzbl -0x19(%rbp), %r11d
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x40de40
addq $0x10, %rsp
jmp 0x402bd8
movq %rbx, %rdi
callq 0x414460
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9c488(%rip), %rdi     # 0x49f0cf
movq %r14, %rsi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x40de40
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebx
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %r15
andl $-0x2, %r9d
cmpl $0x18, %r9d
jne 0x402ccb
testl %ebx, %ebx
jle 0x402cc2
andl $0xf, %ecx
shll $0x5, %r12d
orl %ecx, %r12d
incl %ebx
movl %r12d, %eax
shll $0x8, %eax
movslq %eax, %rdi
addq %r15, %rdi
movl $0x100, %edx            # imm = 0x100
movq %r14, %rsi
callq 0x401040
leal 0x1(%r12), %eax
addl $0x11, %r12d
testb $0xf, %al
cmovnel %eax, %r12d
addq $0x100, %r14            # imm = 0x100
decl %ebx
cmpl $0x1, %ebx
jg 0x402c8c
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
shll $0xc, %r12d
andl $0xf, %ecx
shll $0x8, %ecx
orl %r12d, %ecx
movslq %ecx, %rax
addq %rax, %r15
shll $0x8, %ebx
movslq %ebx, %rdx
movq %r15, %rdi
movq %r14, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x401040
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: trdPush
void trdPush(char* ipath, char* fpath) {
	char buf[0x10000];
	trdFile hd = prepareFile(fpath, buf);
	if (hd.name[0] == 0) return;
	char img[0xa0000];
	memset(img, 0, 0xa0000);
	if (readfile(ipath, img, 0xa0000) < 0) {
		printf("Can't read image '%s'\n", ipath);
		return;
	}
	int files = img[0x8e4];			// test files count
	if (files > 127) {
		printf("Too many files in image\n");
		return;
	}
	int freesec = (img[0x8e5] & 0xff) | ((img[0x8e6] & 0xff) << 8);
	
	if (freesec < hd.slen) {		// test free sectors
		printf("No room for file\n");
		return;
	}
	int lastsec = img[0x8e1] & 0xff;
	int lasttrk = img[0x8e2] & 0xff;
	hd.sec = lastsec;
	hd.trk = lasttrk;
	files++;
	img[0x8e4] = files;
	freesec -= hd.slen;
	img[0x8e5] = freesec & 0xff;
	img[0x8e6] = ((freesec & 0xff00) >> 8);
	int diskType = img[0x8e3] & 0xff;
	char* ptr = img;
	while (*ptr)				// find 1st free descriptor
		ptr += 16;
	memcpy(ptr, (char*)&hd, 16);		// make new descriptor
	int secnum = ((hd.trk << 4) + hd.sec);	// free sector num
	// int fpos = (secnum << 8); 		// position in image
	secnum += hd.slen;
	img[0x8e1] = secnum & 0x0f;
	img[0x8e2] = ((secnum & 0xfff0) >> 4);
	trd_put_data(img, buf, hd.trk, hd.sec, hd.slen, diskType);
	// memcpy(img + fpos, buf, hd.slen << 8);	// copy file data
	savefile(ipath, img, 0xa0000);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0000, %rsp          # imm = 0xB0000
movq %rsi, %rax
movq %rdi, %rbx
leaq -0x10020(%rbp), %rsi
movq %rax, %rdi
callq 0x401df9
movq %rax, %r14
testb %r14b, %r14b
je 0x402e37
movq %rdx, %r15
leaq -0xb0020(%rbp), %r12
movl $0xa0000, %edx          # imm = 0xA0000
movq %r12, %rdi
xorl %esi, %esi
callq 0x4010a0
movq %rbx, %rdi
movq %r12, %rsi
movl $0xa0000, %edx          # imm = 0xA0000
callq 0x401848
testl %eax, %eax
js 0x402d7f
movzwl -0xaf73b(%rbp), %eax
movq %r15, %rcx
shrq $0x28, %rcx
movzbl %cl, %r8d
subl %r8d, %eax
jae 0x402d95
leaq 0x9c7e1(%rip), %rdi     # 0x49f556
callq 0x414ec0
jmp 0x402e37
leaq 0x9c43f(%rip), %rdi     # 0x49f1c5
movq %rbx, %rsi
xorl %eax, %eax
callq 0x40de40
jmp 0x402e37
movzbl -0xaf73f(%rbp), %ecx
movzbl -0xaf73e(%rbp), %edx
movq %rcx, %rsi
shlq $0x30, %rsi
movabsq $0xffffffffffff, %rdi   # imm = 0xFFFFFFFFFFFF
andq %rdi, %r15
incb -0xaf73c(%rbp)
orq %rsi, %r15
movb %al, -0xaf73b(%rbp)
movb %ah, -0xaf73a(%rbp)
movzbl -0xaf73d(%rbp), %r9d
cmpb $0x0, (%r12)
leaq 0x10(%r12), %r12
jne 0x402dd4
movq %rdx, %rax
shlq $0x38, %rax
orq %rax, %r15
movq %r14, -0x10(%r12)
movq %r15, -0x8(%r12)
leal (%r8,%rcx), %eax
movl %eax, %esi
andb $0xf, %sil
leaq -0xb0020(%rbp), %r14
movb %sil, 0x8e1(%r14)
shrl $0x4, %eax
addb %dl, %al
movb %al, 0x8e2(%r14)
leaq -0x10020(%rbp), %rsi
movq %r14, %rdi
callq 0x402c5b
movq %rbx, %rdi
movq %r14, %rsi
movl $0xa0000, %edx          # imm = 0xA0000
callq 0x4018fc
addq $0xb0000, %rsp          # imm = 0xB0000
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x418cf0
movl $0x10, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, -0x30(%rbp)
movq %r15, %rcx
callq 0x4149a0
cmpb $0x0, (%rbx)
je 0x402ed6
xorl %eax, %eax
xorl %r12d, %r12d
movq (%rbx), %rcx
xorq (%r14), %rcx
movb 0x8(%rbx), %dl
xorb 0x8(%r14), %dl
movl %eax, %r13d
movzbl %dl, %r15d
orq %rcx, %r15
cmpl $0x7e, %r12d
ja 0x402eca
testq %r15, %r15
je 0x402eca
movl $0x10, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq -0x30(%rbp), %rcx
callq 0x4149a0
leal 0x10(%r13), %eax
incl %r12d
cmpb $0x0, (%rbx)
jne 0x402e86
xorl %eax, %eax
negq %r15
sbbl %eax, %eax
orl %r13d, %eax
jmp 0x402edb
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %r15d
movq %rsi, %r14
movq %rdi, %rbx
andl $-0x2, %r9d
andl $0xf, %ecx
shll $0x8, %ecx
cmpl $0x18, %r9d
jne 0x402f77
shll $0xd, %edx
orl %edx, %ecx
movslq %ecx, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x418af0
testl %r15d, %r15d
jle 0x402f6c
incl %r15d
movl $0x100, %esi            # imm = 0x100
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x4149a0
movq %rbx, %rdi
callq 0x414aa0
shlq $0x34, %rax
jne 0x402f5c
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movl $0x1, %edx
callq 0x418af0
addq $0x100, %r14            # imm = 0x100
decl %r15d
cmpl $0x1, %r15d
jg 0x402f27
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
shll $0xc, %edx
orl %edx, %ecx
movslq %ecx, %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x418af0
shll $0x8, %r15d
movslq %r15d, %rsi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4149a0
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/mktrd/mctrd.c
// Function: trdPop
void trdPop(char* ipath, char* fname, char* oname) {
	FILE* file = fopen(ipath, "rb");
	if (!file) {
		printf("Can't open image '%s'\n",ipath);
		return;
	}
	char nbuf[9];
	char xbuf[256];
	char buf[0x10000];
	int num = 0;
	makeName(fname, nbuf);
	trdFile hd;
	fseek(file, 0x8e3, SEEK_SET);
	int diskType = fgetc(file) & 0xff;	// 0x16:80ds, 17:40ds, 18:80ss, 19:40ss
	if (fname == NULL) {
		do {
			fseek(file, num << 4, SEEK_SET);
			fread(&hd, 16, 1, file);
			if (hd.name[0] > 31) {
				trd_get_data(file, buf, hd.trk, hd.sec, hd.slen, diskType);
				sprintf(xbuf,"%.3i_%.8s.%c",num,hd.name,hd.ext);
				// printf("%s\n",xbuf);
				saveoutput(xbuf, buf, hd);
			}
			num++;
		} while ((num < 128) && (hd.name[0] != 0x00));
	} else if (trdSeekFile(file, nbuf, &hd) < 0) {
		printf("Can't find file '%s' in image\n",fname);
	} else {
		trd_get_data(file, buf, hd.trk, hd.sec, hd.slen, diskType);
		saveoutput(oname, buf, hd);
	}
	fclose(file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10128, %rsp          # imm = 0x10128
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x9c083(%rip), %rsi     # 0x49f051
callq 0x4148a0
testq %rax, %rax
je 0x403060
movq %rax, %rbx
leaq -0x45(%rbp), %rsi
movq %r15, %rdi
callq 0x401cb1
movl $0x8e3, %esi            # imm = 0x8E3
movq %rbx, %rdi
xorl %edx, %edx
callq 0x418af0
movq %rbx, %rdi
callq 0x418bd0
movzbl %al, %eax
movl %eax, -0x3c(%rbp)
testq %r15, %r15
je 0x403082
leaq -0x45(%rbp), %rsi
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
callq 0x402e47
testl %eax, %eax
js 0x403124
movzbl -0x29(%rbp), %edx
movzbl -0x2a(%rbp), %ecx
movzbl -0x2b(%rbp), %r8d
leaq -0x10150(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl -0x3c(%rbp), %r9d
callq 0x402eea
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq %r14, %rdi
movq %r15, %rsi
callq 0x401ed6
jmp 0x403135
leaq 0x9c068(%rip), %rdi     # 0x49f0cf
movq %r12, %rsi
xorl %eax, %eax
addq $0x10128, %rsp          # imm = 0x10128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x40de40
xorl %r14d, %r14d
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x418af0
movl $0x10, %esi
movl $0x1, %edx
leaq -0x38(%rbp), %rdi
movq %rbx, %rcx
callq 0x4149a0
cmpb $0x20, -0x38(%rbp)
jl 0x40310b
movzbl -0x29(%rbp), %edx
movzbl -0x2a(%rbp), %ecx
movzbl -0x2b(%rbp), %r8d
movq %rbx, %rdi
leaq -0x10150(%rbp), %r13
movq %r13, %rsi
movl -0x3c(%rbp), %r9d
callq 0x402eea
movsbl -0x30(%rbp), %r8d
leaq -0x150(%rbp), %r15
movq %r15, %rdi
leaq 0x9c07b(%rip), %rsi     # 0x49f165
movl %r12d, %edx
leaq -0x38(%rbp), %rcx
xorl %eax, %eax
callq 0x40df10
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq %r15, %rdi
movq %r13, %rsi
callq 0x401ed6
cmpq $0x7e, %r12
ja 0x403135
incq %r12
addq $0x10, %r14
cmpb $0x0, -0x38(%rbp)
jne 0x403088
jmp 0x403135
leaq 0x9c0b1(%rip), %rdi     # 0x49f1dc
movq %r15, %rsi
xorl %eax, %eax
callq 0x40de40
movq %rbx, %rdi
callq 0x414460
addq $0x10128, %rsp          # imm = 0x10128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
leaq 0x9c022(%rip), %rsi     # 0x49f190
callq 0x4148a0
testq %rax, %rax
je 0x4031d3
movq %rax, %rbx
leaq -0x29(%rbp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x401cb1
leaq -0x39(%rbp), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x402e47
testl %eax, %eax
js 0x4031f0
movl %eax, %r12d
leaq -0x29(%rbp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x401cb1
movl %r12d, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x418af0
movl $0x9, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x414bf0
jmp 0x403201
leaq 0x9bef5(%rip), %rdi     # 0x49f0cf
movq %r12, %rsi
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x40de40
leaq 0x9bfe5(%rip), %rdi     # 0x49f1dc
movq %r14, %rsi
xorl %eax, %eax
callq 0x40de40
movq %rbx, %rdi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x414460
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x9be92(%rip), %rsi     # 0x49f0ba
callq 0x401974
testl %eax, %eax
je 0x403243
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0x4018fc
leaq 0x9be74(%rip), %rsi     # 0x49f0be
movq %rbx, %rdi
callq 0x401974
testl %eax, %eax
je 0x403289
movabsq $0x25500524941, %rax    # imm = 0x25500524941
leaq -0x18(%rbp), %rsi
movq %rax, 0x5(%rsi)
movabsq $0x5249414c434e4953, %rax # imm = 0x5249414C434E4953
movq %rax, (%rsi)
movq %rbx, %rdi
movl $0xd, %edx
callq 0x4018fc
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
leaq 0x9be3b(%rip), %rsi     # 0x49f0cb
movq %rbx, %rdi
callq 0x401974
testl %eax, %eax
je 0x4032aa
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0x402af7
leaq 0x9c2b6(%rip), %rdi     # 0x49f567
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0x414ec0
// File: /workspace/github_c_makefile_star2_O1/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
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x4019fd
movl %eax, %eax
leaq 0x9bd31(%rip), %rcx     # 0x49f004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x9c2a9(%rip), %rdi     # 0x49f58c
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x414ec0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x402b99
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x402064
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x40234d