LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: is_memset
int is_memset(void *ptr, uint8_t val, uint32_t size) {
	for (; size; ptr++, size--)
		if (*(uint8_t *) ptr != val)
			return 0;
	return 1;
}

// Assembly:
movl %edx, %ecx
xorl %edx, %edx
pushq $0x1
popq %rax
cmpl %edx, %ecx
je 0x9d75
cmpb %sil, (%rdi,%rdx)
jne 0x9d73
incq %rdx
jmp 0x9d64
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: is_fileset
int is_fileset(char *fpath, uint8_t val, uint32_t offset) {
	int result;
	FILE *f;
	uint8_t b;
	f = fopen(fpath, "r");
	fseek(f, offset, SEEK_SET);
	result = 1;
	// inefficient byte loop
	while (result && fread(&b, sizeof(b), 1, f) == 1)
		if (b != val)
			result = 0;

	fclose(f);
	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %ebp
leaq 0xc295(%rip), %rsi      # 0x16022
callq 0x34b0
movq %rax, %rbx
movl %r14d, %esi
xorl %r14d, %r14d
movq %rax, %rdi
xorl %edx, %edx
callq 0x3400
pushq $0x1
popq %r13
leaq 0x7(%rsp), %r15
pushq $0x1
popq %r12
movl %r13d, %eax
testl %eax, %eax
je 0x9ddf
movq %r15, %rdi
movq %r12, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x3100
cmpq $0x1, %rax
jne 0x9ddc
xorl %eax, %eax
cmpb %bpl, 0x7(%rsp)
sete %al
jmp 0x9db5
movl %r13d, %r14d
movq %rbx, %rdi
callq 0x3150
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: file_write
int file_write(char *fpath, uint8_t *data, unsigned size) {
	int fd;
	// O_TRUNC: set to length 0
	fd = open(fpath, O_CREAT | O_TRUNC | O_RDWR, 0666);
	// or f = fopen(fpath, "w") ;
	if (fd < 0)
		return error_set(ERROR_HOSTFILE, "File write: can not open \"%s\"", fpath);
	write(fd, data, size);
	close(fd);
	return ERROR_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x242, %esi            # imm = 0x242
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x34a0
testl %eax, %eax
js 0x9e41
movl %eax, %r15d
movl %ebp, %edx
movl %eax, %edi
movq %r14, %rsi
callq 0x3140
movl %r15d, %edi
callq 0x3260
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa972(%rip), %rsi      # 0x147ba
pushq $-0x6
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x982c
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: inputline
int inputline(char **tokenlist, int tokenlist_size) {
	static char buffer[1024];
	int n;
	char *t;

	n = 0;
	if (fgets(buffer, sizeof(buffer), stdin)) {
		t = strtok(buffer, " \t\n");
		while (t && n < tokenlist_size - 1) {
			tokenlist[n++] = t;
			t = strtok(NULL, " \t\n");
		}
	}
	tokenlist[n] = NULL; // terminate list
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x12165(%rip), %rax     # 0x1bfd8
movq (%rax), %rdx
leaq 0x14403(%rip), %rdi     # 0x1e280
movl $0x400, %esi            # imm = 0x400
callq 0x32c0
testq %rax, %rax
je 0x9ec7
leaq 0x143ed(%rip), %rdi     # 0x1e280
leaq 0xa93e(%rip), %r15      # 0x147d8
movq %r15, %rsi
callq 0x34d0
decl %ebp
movslq %ebp, %r12
xorl %r14d, %r14d
testq %rax, %rax
je 0x9eca
cmpq %r12, %r14
jge 0x9eca
movq %rax, (%rbx,%r14,8)
incq %r14
xorl %edi, %edi
movq %r15, %rsi
callq 0x34d0
jmp 0x9eaa
xorl %r14d, %r14d
movl %r14d, %eax
andq $0x0, (%rbx,%rax,8)
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: strtrim
char *strtrim(char *txt) {
	static char buff[1024];
	char *s = txt; // start

	assert(strlen(txt) < sizeof(buff));

	// skip leading space
	while (*s && isspace(*s))
		s++;
	strcpy(buff, s); // buff now without leading space
	// s = last last non-white char
	s = buff + strlen(buff) - 1;
	while (s > buff && isspace(*s))
		s--;
	*(s + 1) = 0; // clip off
	return buff;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3190
cmpq $0x3ff, %rax            # imm = 0x3FF
ja 0x9f62
movsbq (%rbx), %r14
testq %r14, %r14
je 0x9f10
callq 0x35d0
movq (%rax), %rax
testb $0x20, 0x1(%rax,%r14,2)
je 0x9f10
incq %rbx
jmp 0x9ef2
leaq 0x14769(%rip), %r14     # 0x1e680
movq %r14, %rdi
movq %rbx, %rsi
callq 0x30c0
movq %r14, %rdi
callq 0x3190
addq %r14, %rax
decq %rax
movq %rax, %rbx
cmpq %r14, %rax
jbe 0x9f4f
callq 0x35d0
movq (%rax), %rcx
movsbq (%rbx), %rdx
leaq -0x1(%rbx), %rax
testb $0x20, 0x1(%rcx,%rdx,2)
jne 0x9f30
movb $0x0, 0x1(%rbx)
leaq 0x14726(%rip), %rax     # 0x1e680
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xa873(%rip), %rdi      # 0x147dc
leaq 0xa887(%rip), %rsi      # 0x147f7
leaq 0xa888(%rip), %rcx      # 0x147ff
movl $0xbe, %edx
callq 0x3200
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: strrpad
char *strrpad(char *txt, int len, char c) {
	static char buff[1024];
	memset(buff, c, len); // init buffer with base pattern
	strncpy(buff, txt, strlen(txt));
	buff[len] = 0;
	return buff;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movslq %esi, %r14
leaq 0x14aed(%rip), %r15     # 0x1ea80
movq %r15, %rdi
movl %edx, %esi
movq %r14, %rdx
callq 0x3220
movq %rbx, %rdi
callq 0x3190
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x30a0
movb $0x0, (%r14,%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: strprintable
char *strprintable(char *s, int size) {
	static char buffer[1024] ;
	char buf[10] ;
	int i ;
	char c ;
	char *wp = buffer ;
	*wp = 0 ;
	for (i= 0 ;  i < size ; i++) {
		c = s[i] ;
		// must be room for one more char expr
		assert(wp-buffer < (int)sizeof(buffer)-5) ;
		if (c == 0) {
			strcat(wp, "<NUL>") ;
			wp += 5 ;
		} else if (c == 0x07) {
			strcat(wp, "<BEL>") ;
			wp += 5 ;
		} else if (c == 0x0a) {
			strcat(wp, "<LF>") ;
			wp += 4 ;
		} else if (c == 0x0d) {
			strcat(wp, "<CR>") ;
			wp += 4 ;
		} else if (c == 0x20) {
				strcat(wp, "<SPC>") ;
				wp += 5 ;
		} else if (c <= 0x1f || c >= 0x7f) {
			sprintf(buf, "\\x%.2x", (int)c) ;
			strcat(wp, buf) ;
			wp += strlen(buf) ;
		} else
			*wp++ = c ;
		*wp=0 ;
	}
	return buffer ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
movb $0x0, 0x14ea2(%rip)     # 0x1ee80
leaq 0x14e9b(%rip), %rbp     # 0x1ee80
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %ebx
leaq 0xe(%rsp), %r12
xorl %r15d, %r15d
movq %rbp, %r13
cmpq %r15, %rbx
je 0xa0f5
movq %r13, %rax
subq %rbp, %rax
cmpq $0x3fb, %rax            # imm = 0x3FB
jge 0xa10b
movb (%r14,%r15), %al
movzbl %al, %ecx
cmpl $0x20, %ecx
je 0xa0c2
cmpl $0x7, %ecx
je 0xa04b
cmpl $0xa, %ecx
je 0xa071
cmpl $0xd, %ecx
je 0xa05e
testl %ecx, %ecx
jne 0xa08e
movq %r13, %rdi
callq 0x3190
movl $0x4c554e3c, (%r13,%rax) # imm = 0x4C554E3C
jmp 0xa0d3
movq %r13, %rdi
callq 0x3190
movl $0x4c45423c, (%r13,%rax) # imm = 0x4C45423C
jmp 0xa0d3
movq %r13, %rdi
callq 0x3190
movl $0x3e52433c, (%r13,%rax) # imm = 0x3E52433C
jmp 0xa082
movq %r13, %rdi
callq 0x3190
movl $0x3e464c3c, (%r13,%rax) # imm = 0x3E464C3C
movb $0x0, 0x4(%r13,%rax)
addq $0x4, %r13
jmp 0xa0df
leal -0x7f(%rax), %ecx
cmpb $-0x60, %cl
ja 0xa0ec
movsbl %al, %edx
movq %r12, %rdi
leaq 0xa7d0(%rip), %rsi      # 0x14873
xorl %eax, %eax
callq 0x3530
movq %r13, %rdi
movq %r12, %rsi
callq 0x3510
movq %r12, %rdi
callq 0x3190
addq %rax, %r13
jmp 0xa0df
movq %r13, %rdi
callq 0x3190
movl $0x4350533c, (%r13,%rax) # imm = 0x4350533C
movw $0x3e, 0x4(%r13,%rax)
addq $0x5, %r13
movb $0x0, (%r13)
incq %r15
jmp 0x9ff7
movb %al, (%r13)
incq %r13
jmp 0xa0df
leaq 0x14d84(%rip), %rax     # 0x1ee80
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa703(%rip), %rdi      # 0x14815
leaq 0xa6de(%rip), %rsi      # 0x147f7
leaq 0xa717(%rip), %rcx      # 0x14837
movl $0xe0, %edx
callq 0x3200
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: rad50_decode
char *rad50_decode(uint16_t w) {
	static char result[4];
	result[2] = rad50_val2chr(w % 050);
	w /= 050;
	result[1] = rad50_val2chr(w % 050);
	w /= 050;
	result[0] = rad50_val2chr(w);
	result[3] = 0;
	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movw $0x28, %r15w
movl %ebx, %eax
xorl %edx, %edx
divw %r15w
movl %eax, %ebp
movzwl %dx, %edi
callq 0xa19b
movb %al, 0x15132(%rip)      # 0x1f282
leaq 0x15129(%rip), %r14     # 0x1f280
movl %ebp, %eax
xorl %edx, %edx
divw %r15w
movzwl %dx, %edi
callq 0xa19b
movb %al, 0x15114(%rip)      # 0x1f281
movw $0x640, %cx             # imm = 0x640
movl %ebx, %eax
xorl %edx, %edx
divw %cx
movzwl %ax, %edi
callq 0xa19b
movb %al, 0x150fa(%rip)      # 0x1f280
movb $0x0, 0x150f6(%rip)     # 0x1f283
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: rad50_val2chr
static int rad50_val2chr(int val) {
	if (val == 000)
		return ' ';
	else if (val >= 001 && val <= 032)
		return 'A' + val - 001;
	else if (val == 033)
		return '$';
	else if (val == 034)
		return '.';
	else if (val == 035)
		return '%';
	else if (val >= 036 && val <= 047)
		return '0' + val - 036;
	else
		return '%'; // RT-11 for "invalid"
}

// Assembly:
testl %edi, %edi
je 0xa1aa
movl %edi, %eax
cmpl $0x1a, %edi
jg 0xa1ae
addl $0x40, %eax
retq
pushq $0x20
popq %rax
retq
leal -0x1b(%rax), %ecx
cmpl $0x3, %ecx
jae 0xa1c3
movl %ecx, %eax
leaq 0xa71d(%rip), %rcx      # 0x148dc
movl (%rcx,%rax,4), %eax
retq
leal -0x1e(%rax), %ecx
addl $0x12, %eax
cmpl $0xa, %ecx
pushq $0x25
popq %rcx
cmovbl %eax, %ecx
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: rad50_encode
uint16_t rad50_encode(char *s) {
	uint16_t result = 0;
	int n;
	if (!s)
		return 0; // 3 spaces

	n = strlen(s);
	if (n > 0)
		result += rad50_chr2val(toupper(s[0]));
	result *= 050;
	if (n > 1)
		result += rad50_chr2val(toupper(s[1]));
	result *= 050;
	if (n > 2)
		result += rad50_chr2val(toupper(s[2]));
	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0xa23a
movq %rdi, %rbx
callq 0x3190
movq %rax, %r14
testl %r14d, %r14d
jle 0xa23e
callq 0x3030
movq (%rax), %r15
movsbq (%rbx), %rax
movl (%r15,%rax,4), %edi
callq 0xa250
imull $0x28, %eax, %ebp
cmpl $0x1, %r14d
je 0xa240
movsbq 0x1(%rbx), %rax
movl (%r15,%rax,4), %edi
callq 0xa250
addl %eax, %ebp
imull $0x28, %ebp, %ebp
cmpl $0x3, %r14d
jb 0xa243
movsbq 0x2(%rbx), %rax
movl (%r15,%rax,4), %edi
callq 0xa250
addl %eax, %ebp
jmp 0xa243
xorl %ebp, %ebp
jmp 0xa243
xorl %ebp, %ebp
imull $0x28, %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: rad50_chr2val
static int rad50_chr2val(int c) {
	if (c == ' ')
		return 000;
	else if (c >= 'A' && c <= 'Z')
		/// => 000001..011010
		return 1 + c - 'A';
	else if (c == '$')
		return 033;
	else if (c == '.')
		return 034;
	else if (c == '%')
		return 035;
	else if (c >= '0' && c <= '9')
		return 036 + c - '0';
	else
		return 035; // RT-11 for "invalid"
}

// Assembly:
xorl %eax, %eax
cmpl $0x20, %edi
jne 0xa258
retq
leal -0x41(%rdi), %eax
cmpl $0x19, %eax
ja 0xa266
addl $-0x40, %edi
movl %edi, %eax
retq
cmpl $0x24, %edi
je 0xa27d
cmpl $0x25, %edi
je 0xa279
cmpl $0x2e, %edi
jne 0xa281
pushq $0x1c
jmp 0xa27f
pushq $0x1d
jmp 0xa27f
pushq $0x1b
popq %rax
retq
leal -0x30(%rdi), %eax
addl $-0x12, %edi
cmpl $0xa, %eax
pushq $0x1d
popq %rax
cmovbl %edi, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: file_exists
int file_exists(char *path, char *filename) {
	char buffer[4096];
	struct stat st;
	if (path && strlen(path))
		sprintf(buffer, "%s/%s", path, filename);
	else
		strcpy(buffer, filename);
	return !stat(buffer, &st);

}

// Assembly:
subq $0x1098, %rsp           # imm = 0x1098
movq %rsi, %rcx
testq %rdi, %rdi
je 0xa2c0
movq %rdi, %rdx
cmpb $0x0, (%rdi)
je 0xa2c0
leaq 0xa1e0(%rip), %rsi      # 0x1448f
leaq 0x90(%rsp), %rdi
xorl %eax, %eax
callq 0x3530
jmp 0xa2d0
leaq 0x90(%rsp), %rdi
movq %rcx, %rsi
callq 0x30c0
leaq 0x90(%rsp), %rdi
movq %rsp, %rsi
callq 0x3320
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movl %ecx, %eax
addq $0x1098, %rsp           # imm = 0x1098
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: extract_extension
char *extract_extension(char *filename, int truncate) {
	char *dotpos;
	char *s;

	// find the last "."
	dotpos = NULL;
	for (s = filename; *s; s++)
		if (*s == '.')
			dotpos = s;

	if (dotpos) {
		if (truncate)
			*dotpos = 0; // clip off "." and extension
		return dotpos + 1;
	} else
		return NULL;
}

// Assembly:
xorl %eax, %eax
movzbl (%rdi), %ecx
cmpl $0x2e, %ecx
je 0xa301
testl %ecx, %ecx
jne 0xa304
jmp 0xa309
movq %rdi, %rax
incq %rdi
jmp 0xa2f3
testq %rax, %rax
je 0xa319
testl %esi, %esi
je 0xa315
movb $0x0, (%rax)
incq %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: dos11date_decode
struct tm dos11date_decode(uint16_t w) {
	int *monthlen;
	struct tm result;
	int y = (w / 1000) + 1970;
	int m;
	int d = w % 1000; // starts as day of year

	memset(&result, 0, sizeof(result)); //clear

	// use correct table
	monthlen = leapyear(y) ? monthlen_leap : monthlen_noleap;

	m = 0;
	while (d > monthlen[m]) {
		d -= monthlen[m];
		m++;
	}
	result.tm_year = y - 1900;
	result.tm_mon = m; // 0..11
	result.tm_mday = d; // 1..31

	assert(w == dos11date_encode(result)); // cross check
	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movw $0x3e8, %cx             # imm = 0x3E8
movl %ebp, %eax
xorl %edx, %edx
divw %cx
xorl %r14d, %r14d
movzwl %ax, %r15d
leal 0x7b2(%r15), %edi
movzwl %dx, %r12d
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
andq $0x0, 0x30(%rbx)
callq 0xa31c
testl %eax, %eax
leaq 0x120ad(%rip), %rcx     # 0x1c440
leaq 0x120d6(%rip), %rax     # 0x1c470
cmoveq %rcx, %rax
movl %r12d, %ecx
subl (%rax,%r14,4), %ecx
jle 0xa3af
incq %r14
movl %ecx, %r12d
jmp 0xa3a1
addl $0x46, %r15d
movl %r15d, 0x14(%rbx)
movl %r14d, 0x10(%rbx)
movl %r12d, 0xc(%rbx)
movq 0x30(%rbx), %rax
movq %rax, 0x30(%rsp)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0xa41a
cmpw %bp, %ax
jne 0xa3fb
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa478(%rip), %rdi      # 0x1487a
leaq 0xa3ee(%rip), %rsi      # 0x147f7
leaq 0xa488(%rip), %rcx      # 0x14898
movl $0x181, %edx            # imm = 0x181
callq 0x3200
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: dos11date_encode
uint16_t dos11date_encode(struct tm t) {
	int *monthlen;
	uint16_t result = 0;
	int doy;
	int y = 1900 + t.tm_year; // year is easy
	int m;

	monthlen = leapyear(y) ? monthlen_leap : monthlen_noleap;

	for (doy = m = 0; m < t.tm_mon; m++)
		doy += monthlen[m];

	result = doy + t.tm_mday;
	result += 1000 * (y - 1970);
	return result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x20(%rsp), %rbx
movl 0x14(%rbx), %r14d
leal 0x76c(%r14), %edi
callq 0xa31c
testl %eax, %eax
leaq 0x12004(%rip), %rcx     # 0x1c440
leaq 0x1202d(%rip), %rax     # 0x1c470
cmoveq %rcx, %rax
movl 0x10(%rbx), %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
xorl %esi, %esi
cmpq %rdx, %rcx
je 0xa460
addl (%rax,%rdx,4), %esi
incq %rdx
jmp 0xa453
movl 0xc(%rbx), %eax
imull $0x3e8, %r14d, %ecx     # imm = 0x3E8
addl %esi, %ecx
addl %ecx, %eax
addl $0xffffee90, %eax       # imm = 0xFFFFEE90
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: hexdump_put
static void hexdump_put(FILE *stream, unsigned start, char *line_hexb, char* line_hexw,
		char *line_ascii) {
	// expand half filled lines
	while (strlen(line_hexb) < HEXDUMP_BYTESPERLINE * 3)
		strcat(line_hexb, " ");
	while (strlen(line_hexw) < (HEXDUMP_BYTESPERLINE / 2) * 5)
		strcat(line_hexw, " ");
	while (strlen(line_ascii) < HEXDUMP_BYTESPERLINE)
		strcat(line_ascii, " ");
	fprintf(stream, "%3x: %s   %s  %s\n", start, line_hexb, line_hexw, line_ascii);
	line_hexb[0] = 0; // clear output
	line_hexw[0] = 0;
	line_ascii[0] = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r12
movq %r15, %rdi
callq 0x3190
cmpq $0x30, %rax
jae 0xa71c
movq %r15, %rdi
callq 0x3190
movw $0x20, (%r15,%rax)
jmp 0xa6ee
movq %r14, %rdi
callq 0x3190
movw $0x20, (%r14,%rax)
movq %r14, %rdi
callq 0x3190
cmpq $0x28, %rax
jb 0xa70d
jmp 0xa73a
movq %rbx, %rdi
callq 0x3190
movw $0x20, (%rbx,%rax)
movq %rbx, %rdi
callq 0x3190
cmpq $0xf, %rax
jbe 0xa72c
leaq 0xa178(%rip), %rsi      # 0x148c7
xorl %r13d, %r13d
movq %r12, %rdi
movl %ebp, %edx
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x3310
movb %r13b, (%r15)
movb %r13b, (%r14)
movb %r13b, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/utils.c
// Function: search_tagged_array
void *search_tagged_array(void *base, int element_size, int search_val) {
	uint8_t *ptr = base;
	int cur_tag;

	cur_tag = *(int *) ptr;
	while (cur_tag != search_val && cur_tag != 0) {
		ptr += element_size;
		cur_tag = *(int *) ptr;
	}
	if (cur_tag)
		return ptr;
	else
		return NULL;
}

// Assembly:
movslq %esi, %rax
movl (%rdi), %ecx
cmpl %edx, %ecx
je 0xa791
testl %ecx, %ecx
je 0xa791
addq %rax, %rdi
jmp 0xa782
xorl %eax, %eax
testl %ecx, %ecx
cmovneq %rdi, %rax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/boolarray.c
// Function: boolarray_create
boolarray_t *boolarray_create(uint32_t bitcount) {
	boolarray_t *result = malloc(sizeof(boolarray_t));
	result->bitcount = bitcount;
	result->flags = malloc((bitcount / 32) + 1);
	boolarray_clear(result);
	return result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
pushq $0x10
popq %rdi
callq 0x33b0
movq %rax, %r14
movl %ebx, 0x8(%rax)
shrl $0x5, %ebx
incl %ebx
pushq $0x1
popq %rdi
movq %rbx, %rsi
callq 0x32d0
movq %rax, (%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/boolarray.c
// Function: boolarray_bit_set
void boolarray_bit_set(boolarray_t *_this, uint32_t i) {
	assert(i < _this->bitcount);
	uint32_t w = _this->flags[i / 32];
	w |= (1 << (i % 32));
	_this->flags[i / 32] = w;
}

// Assembly:
cmpl %esi, 0x8(%rdi)
jbe 0xa811
movq (%rdi), %rax
movl %esi, %edx
pushq $0x1
popq %rdi
movl %esi, %ecx
shll %cl, %edi
shrl $0x5, %edx
orl %edi, (%rax,%rdx,4)
retq
pushq %rax
leaq 0xa0cf(%rip), %rdi      # 0x148e8
leaq 0xa0dc(%rip), %rsi      # 0x148fc
leaq 0xa0e1(%rip), %rcx      # 0x14908
pushq $0x40
popq %rdx
callq 0x3200
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/boolarray.c
// Function: boolarray_bit_clear
void boolarray_bit_clear(boolarray_t *_this, uint32_t i) {
	assert(i < _this->bitcount);
	uint32_t w = _this->flags[i / 32];
	w &= ~(1 << (i % 32));
	_this->flags[i / 32] = w;
}

// Assembly:
cmpl %esi, 0x8(%rdi)
jbe 0xa847
movq (%rdi), %rax
movl %esi, %edx
pushq $-0x2
popq %rdi
movl %esi, %ecx
roll %cl, %edi
shrl $0x5, %edx
andl %edi, (%rax,%rdx,4)
retq
pushq %rax
leaq 0xa099(%rip), %rdi      # 0x148e8
leaq 0xa0a6(%rip), %rsi      # 0x148fc
leaq 0xa0db(%rip), %rcx      # 0x14938
pushq $0x47
popq %rdx
callq 0x3200
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/boolarray.c
// Function: boolarray_print_diag
void boolarray_print_diag(boolarray_t *_this, FILE *stream, uint32_t bitcount, char *info) {
	int any = 0;
	unsigned start, end;
	if (bitcount <= 0 || bitcount > _this->bitcount)
		bitcount = _this->bitcount ;
		fprintf(stream, "%s - Dump of boolarray@%p, bits 0..%d: ", info, _this, bitcount-1);
	start = 0;
	while (start < bitcount) {
		// find next set bit
		while (start < bitcount && !boolarray_bit_get(_this, start))
			start++;
		// find next clr bit
		end = start;
		while (end < bitcount && boolarray_bit_get(_this, end))
			end++;
		if (start < bitcount) {
			if (!any)
				fprintf(stream, "bits set =\n");
			else
				fprintf(stream, ",");
			if (end - start > 1)
				fprintf(stream, "%d-%d", start, end - 1);
			else
				fprintf(stream, "%d", start);
			any = 1;
		}
		start = end;
	}
	if (!any)
		fprintf(stream, "no bits set.\n");
	else
		fprintf(stream, ".\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r9
movq %rdi, %r14
movl 0x8(%rdi), %eax
cmpl %edx, %eax
movl %edx, %r15d
cmovbl %eax, %r15d
testl %edx, %edx
cmovel %eax, %r15d
leal -0x1(%r15), %r8d
leaq 0xa0cf(%rip), %rsi      # 0x14999
xorl %r13d, %r13d
movq %r9, (%rsp)
movq %r9, %rdi
movq %rcx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x3310
movb $0x1, %r12b
cmpl %r15d, %r13d
jae 0xa997
movl %r13d, %ebp
cmpl %r15d, %ebp
jae 0xa907
movq %r14, %rdi
movl %ebp, %esi
callq 0xa865
testl %eax, %eax
jne 0xa907
incl %ebp
jmp 0xa8f0
xorl %ebx, %ebx
movl %ebp, %r13d
cmpl %r15d, %r13d
jae 0xa927
movq %r14, %rdi
movl %r13d, %esi
callq 0xa865
testl %eax, %eax
je 0xa927
incl %r13d
incl %ebx
jmp 0xa90c
cmpl %r15d, %ebp
jae 0xa8e4
testb $0x1, %r12b
je 0xa94a
leaq 0xa088(%rip), %rdi      # 0x149c1
pushq $0xb
popq %rsi
pushq $0x1
popq %rdx
movq (%rsp), %rcx
callq 0x3550
jmp 0xa956
pushq $0x2c
popq %rdi
movq (%rsp), %rsi
callq 0x3290
cmpl $0x2, %ebx
jb 0xa97b
leal -0x1(%r13), %ecx
xorl %r12d, %r12d
movq (%rsp), %rdi
leaq 0xa060(%rip), %rsi      # 0x149cd
movl %ebp, %edx
xorl %eax, %eax
callq 0x3310
jmp 0xa8e4
xorl %r12d, %r12d
movq (%rsp), %rdi
leaq 0xa6a1(%rip), %rsi      # 0x1502a
movl %ebp, %edx
xorl %eax, %eax
callq 0x3310
jmp 0xa8e4
testb $0x1, %r12b
je 0xa9a8
leaq 0xa02f(%rip), %rdi      # 0x149d3
pushq $0xd
jmp 0xa9b1
leaq 0x6a39(%rip), %rdi      # 0x113e8
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq (%rsp), %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3550
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/filesystem.c
// Function: filesystem_create
filesystem_t *filesystem_create(filesystem_type_t type, device_type_t device_type, int readonly,
		uint8_t *image_data, uint32_t image_data_size, boolarray_t *changedblocks) {
	filesystem_t *_this;
	_this = malloc(sizeof(filesystem_t));
	_this->type = type;
	_this->readonly = readonly;
	_this->xxdp = NULL;
	_this->rt11 = NULL;

	switch (type) {
	case fsXXDP:
		_this->xxdp = xxdp_filesystem_create(device_type, image_data, image_data_size,
				changedblocks);
		_this->file_count = &(_this->xxdp->file_count);
		break;
	case fsRT11:
		_this->rt11 = rt11_filesystem_create(device_type, image_data, image_data_size,
				changedblocks);
		_this->file_count = &(_this->rt11->file_count);
		break;
	default:
		fprintf(ferr, "filesystem_create(): unknown type");
	}
	return _this;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movl %r8d, %ebp
movq %rcx, %r15
movl %edx, %r14d
movl %esi, %r12d
movl %edi, %r13d
pushq $0x20
popq %rdi
callq 0x33b0
movq %rax, %rbx
movl %r13d, (%rax)
movl %r14d, 0x4(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
cmpl $0x2, %r13d
je 0xaceb
cmpl $0x1, %r13d
jne 0xad0c
movl %r12d, %edi
movq %r15, %rsi
movl %ebp, %edx
movq (%rsp), %rcx
callq 0xb324
movq %rax, 0x8(%rbx)
addq $0xa8, %rax
jmp 0xad06
movl %r12d, %edi
movq %r15, %rsi
movl %ebp, %edx
movq (%rsp), %rcx
callq 0xd93c
movq %rax, 0x10(%rbx)
addq $0x8c, %rax
movq %rax, 0x18(%rbx)
jmp 0xad28
leaq 0x1351d(%rip), %rax     # 0x1e230
movq (%rax), %rcx
leaq 0x9cde(%rip), %rdi      # 0x149fb
pushq $0x21
popq %rsi
pushq $0x1
popq %rdx
callq 0x3550
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/filesystem.c
// Function: filesystem_destroy
void filesystem_destroy(filesystem_t *_this) {
	switch (_this->type) {
	case fsXXDP:
		xxdp_filesystem_destroy(_this->xxdp);
		break;
	case fsRT11:
		rt11_filesystem_destroy(_this->rt11);
		break;
	default:
		fprintf(ferr, "xxdp_filesystem_destroy(): unknown type");
	}
	free(_this);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x2, %eax
je 0xad55
cmpl $0x1, %eax
jne 0xad60
movq 0x8(%rbx), %rdi
callq 0xb65e
jmp 0xad7c
movq 0x10(%rbx), %rdi
callq 0xdba8
jmp 0xad7c
leaq 0x134c9(%rip), %rax     # 0x1e230
movq (%rax), %rcx
leaq 0x9cac(%rip), %rdi      # 0x14a1d
pushq $0x27
popq %rsi
pushq $0x1
popq %rdx
callq 0x3550
movq %rbx, %rdi
popq %rbx
jmp 0x3050
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/filesystem.c
// Function: filesystem_init
void filesystem_init(filesystem_t *_this) {
	switch (_this->type) {
	case fsXXDP:
		return xxdp_filesystem_init(_this->xxdp);
	case fsRT11:
		return rt11_filesystem_init(_this->rt11);
	default:
		fprintf(ferr, "filesystem_init(): unknown type");
	}
}

// Assembly:
movl (%rdi), %eax
cmpl $0x2, %eax
je 0xad9a
cmpl $0x1, %eax
jne 0xada3
movq 0x8(%rdi), %rdi
jmp 0xb539
movq 0x10(%rdi), %rdi
jmp 0xda55
leaq 0x13486(%rip), %rax     # 0x1e230
movq (%rax), %rcx
leaq 0x9c91(%rip), %rdi      # 0x14a45
pushq $0x1f
popq %rsi
pushq $0x1
popq %rdx
jmp 0x3550
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/filesystem.c
// Function: filesystem_parse
int filesystem_parse(filesystem_t *_this) {
	switch (_this->type) {
	case fsXXDP:
		return xxdp_filesystem_parse(_this->xxdp);
	case fsRT11:
		return rt11_filesystem_parse(_this->rt11);
	default:
		return error_set(ERROR_FILESYSTEM_INVALID, "Filesystem not supported");
	}
}

// Assembly:
movl (%rdi), %eax
cmpl $0x2, %eax
je 0xadd4
cmpl $0x1, %eax
jne 0xaddd
movq 0x8(%rdi), %rdi
jmp 0xb6ac
movq 0x10(%rdi), %rdi
jmp 0xdbcf
leaq 0x9c81(%rip), %rsi      # 0x14a65
pushq $-0x4
popq %rdi
xorl %eax, %eax
jmp 0x982c
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/filesystem.c
// Function: filesystem_file_add
int filesystem_file_add(filesystem_t *_this, char *hostfname, time_t hostfdate, mode_t hostmode,
		uint8_t *data, uint32_t data_size) {
	switch (_this->type) {
	case fsXXDP: {
		return xxdp_filesystem_file_add(_this->xxdp, hostfname, hostfdate, data, data_size);
	}
	case fsRT11: {
		char *streamname = NULL;
		char *ext = extract_extension(hostfname, 0); // only test, do not clip
		// is last extension a known streamname?
		if (ext)
			if (!strcasecmp(ext, RT11_STREAMNAME_DIREXT)
					|| !strcasecmp(ext, RT11_STREAMNAME_PREFIX))
				streamname = extract_extension(hostfname, 1); // now clip
		return rt11_filesystem_file_stream_add(_this->rt11, hostfname, streamname, hostfdate,
				hostmode, data, data_size);
	}
	default:
		return error_set(ERROR_FILESYSTEM_INVALID, "Filesystem not supported");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
movl (%rdi), %eax
cmpl $0x2, %eax
je 0xae37
cmpl $0x1, %eax
jne 0xae80
movq 0x8(%r13), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r8, %rcx
movl %ebp, %r8d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc85e
movl %ecx, 0xc(%rsp)
movq %r8, 0x10(%rsp)
xorl %r12d, %r12d
movq %r15, %rdi
xorl %esi, %esi
callq 0xa2f1
testq %rax, %rax
je 0xaead
movq %rax, %rbx
leaq 0x9c22(%rip), %rsi      # 0x14a7e
movq %rax, %rdi
callq 0x3060
testl %eax, %eax
je 0xae9f
leaq 0x9c16(%rip), %rsi      # 0x14a85
movq %rbx, %rdi
callq 0x3060
testl %eax, %eax
je 0xae9f
xorl %r12d, %r12d
jmp 0xaead
leaq 0x9bde(%rip), %rsi      # 0x14a65
pushq $-0x4
popq %rdi
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x982c
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0xa2f1
movq %rax, %r12
movq 0x10(%r13), %rdi
movl %ebp, (%rsp)
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %rcx
movl 0xc(%rsp), %r8d
movq 0x10(%rsp), %r9
callq 0xe7f7
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/filesystem.c
// Function: filesystem_render
int filesystem_render(filesystem_t *_this) {
	switch (_this->type) {
	case fsXXDP:
		return xxdp_filesystem_render(_this->xxdp);
	case fsRT11:
		return rt11_filesystem_render(_this->rt11);
	default:
		return error_set(ERROR_FILESYSTEM_INVALID, "Filesystem not supported");
	}
}

// Assembly:
movl (%rdi), %eax
cmpl $0x2, %eax
je 0xb160
cmpl $0x1, %eax
jne 0xb169
movq 0x8(%rdi), %rdi
jmp 0xbe0d
movq 0x10(%rdi), %rdi
jmp 0xe305
leaq 0x98f5(%rip), %rsi      # 0x14a65
pushq $-0x4
popq %rdi
xorl %eax, %eax
jmp 0x982c
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/device_info.c
// Function: device_type_to_name
char *device_type_to_name(device_type_t device_type) {
	device_info_t *di  = (device_info_t*) search_tagged_array(device_info_table, sizeof(device_info_t),
			device_type);
	if (! di)
		return NULL ;
	else
		return di->device_name ;
}

// Assembly:
pushq %rax
movl %edi, %edx
leaq 0x1122a(%rip), %rdi     # 0x1c4b0
pushq $0x20
popq %rsi
callq 0xa77f
testq %rax, %rax
je 0xb299
movq 0x8(%rax), %rax
jmp 0xb29b
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/device_info.c
// Function: device_type_from_name
device_type_t device_type_from_name(char * name) {
	// search for name
	device_info_t *di ;
	for (di = device_info_table ; di->device_type ; di++)
		if (!strcasecmp(name, di->device_name))
			return di->device_type;
	return devNONE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x11205(%rip), %r14     # 0x1c4b0
movl (%r14), %ebp
testl %ebp, %ebp
je 0xb2c6
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x3060
addq $0x20, %r14
testl %eax, %eax
jne 0xb2ab
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/device_info.c
// Function: device_type_namelist
char *device_type_namelist() {
	static char buffer[1024];
	device_info_t *di ;
	buffer[0] = 0;
	for (di = device_info_table ; di->device_type ; di++) {
		if (strlen(buffer))
			strcat(buffer, ",");
		strcat(buffer, di->device_name);
	}
	return buffer;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movb $0x0, 0x141a8(%rip)     # 0x1f480
leaq 0x111d1(%rip), %r14     # 0x1c4b0
leaq 0x1419a(%rip), %rbx     # 0x1f480
cmpl $0x0, (%r14)
je 0xb315
cmpb $0x0, 0x1418d(%rip)     # 0x1f480
je 0xb303
movq %rbx, %rdi
callq 0x3190
movw $0x2c, (%rax,%rbx)
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x3510
addq $0x20, %r14
jmp 0xb2e6
leaq 0x14164(%rip), %rax     # 0x1f480
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/xxdp.c
// Function: xxdp_filesystem_destroy
void xxdp_filesystem_destroy(xxdp_filesystem_t *_this) {
	xxdp_filesystem_init(_this); // free files
	free(_this->bootblock);
	free(_this->monitor);
	free(_this->bitmap);
	free(_this->mfd_blocklist);
	free(_this->ufd_blocklist);
	free(_this);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xb539
movq 0x80(%rbx), %rdi
callq 0x3050
movq 0x88(%rbx), %rdi
callq 0x3050
movq 0x90(%rbx), %rdi
callq 0x3050
movq 0x98(%rbx), %rdi
callq 0x3050
movq 0xa0(%rbx), %rdi
callq 0x3050
movq %rbx, %rdi
popq %rbx
jmp 0x3050
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/xxdp.c
// Function: parse_stream
static void parse_stream(xxdp_filesystem_t *_this, xxdp_multiblock_t *multiblock,
		xxdp_blocknr_t start, xxdp_blocknr_t blockcount) {
	multiblock->blockcount = blockcount;
	multiblock->blocknr = start;
	multiblock->data_size = XXDP_BLOCKSIZE * blockcount;
	multiblock->data = malloc(multiblock->data_size);
	memcpy(multiblock->data, IMAGE_BLOCKNR2PTR(_this, start), multiblock->data_size);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
movw %bx, 0x2(%rsi)
movw %r14w, (%rsi)
shll $0x9, %ebx
movl %ebx, 0x10(%rsi)
movq %rbx, %rdi
callq 0x33b0
movq %rax, 0x8(%r15)
shll $0x9, %r14d
addq (%r12), %r14
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3340
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/xxdp.c
// Function: xxdp_filename_from_host
char *xxdp_filename_from_host(char *hostfname, char *filnam, char *ext) {
	static char result[80];
	char pathbuff[4096];
	char _filnam[7], _ext[4];
	char *s, *t;

	strcpy(pathbuff, hostfname);

	// upcase and replace forbidden characters
	for (s = pathbuff; *s; s++)
		if (*s == '_')
			*s = ' ';
		else {
			*s = toupper(*s);
			if (!strchr(" ABCDEFGHIJKLMNOPQRSTUVWXYZ$.%0123456789", *s))
				*s = '%';
		}

	// search last "."
	s = extract_extension(pathbuff, /*truncate*/1);
	t = _ext; // extract 3 char ext
	while (s && *s && (t - _ext) < 3)
		*t++ = *s++;
	*t = 0;

	// extract 6 char filnam
	s = pathbuff; // only filename
	t = _filnam;
	while (*s && (t - _filnam) < 6)
		*t++ = *s++;
	*t = 0;

	if (filnam) // length MUST be >= 7
		strcpy(filnam, strtrim(_filnam));
	if (ext) // length MUST be >= 4
		strcpy(ext, strtrim(_ext));

	strcpy(result, strtrim(_filnam));
	if (strlen(_ext)) {
		strcat(result, ".");
		strcat(result, strtrim(_ext));
	}

	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1028, %rsp           # imm = 0x1028
movq %rdx, 0x18(%rsp)
movq %rsi, %r14
movq %rdi, %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdi
callq 0x30c0
leaq 0x81ac(%rip), %r12      # 0x14dd1
pushq $0x29
popq %r13
pushq $0x25
popq %rbp
movzbl (%r15), %eax
movb $0x20, %cl
cmpl $0x5f, %eax
je 0xcc61
testl %eax, %eax
je 0xcc69
movsbq %al, %rbx
callq 0x3030
movq (%rax), %rax
movl (%rax,%rbx,4), %ebx
movsbl %bl, %esi
movq %r12, %rdi
movq %r13, %rdx
callq 0x32a0
movl %ebp, %ecx
testq %rax, %rax
je 0xcc61
movl %ebx, %ecx
movb %cl, (%r15)
incq %r15
jmp 0xcc2c
leaq 0x20(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0xa2f1
xorl %ecx, %ecx
movq %rax, %rdx
addq %rcx, %rdx
je 0xcc95
movb (%rdx), %dl
testb %dl, %dl
je 0xcc95
cmpq $0x2, %rcx
jg 0xcc95
movb %dl, 0xd(%rsp,%rcx)
incq %rcx
jmp 0xcc78
movb $0x0, 0xd(%rsp,%rcx)
xorl %eax, %eax
movb 0x20(%rsp,%rax), %cl
testb %cl, %cl
je 0xccb3
cmpq $0x5, %rax
jg 0xccb3
movb %cl, 0x11(%rsp,%rax)
incq %rax
jmp 0xcc9c
movb $0x0, 0x11(%rsp,%rax)
testq %r14, %r14
je 0xccd2
leaq 0x11(%rsp), %rdi
callq 0x9ede
movq %r14, %rdi
movq %rax, %rsi
callq 0x30c0
movq 0x18(%rsp), %rbx
testq %rbx, %rbx
je 0xccf1
leaq 0xd(%rsp), %rdi
callq 0x9ede
movq %rbx, %rdi
movq %rax, %rsi
callq 0x30c0
leaq 0x11(%rsp), %rdi
callq 0x9ede
leaq 0x1463e(%rip), %rbx     # 0x21340
movq %rbx, %rdi
movq %rax, %rsi
callq 0x30c0
cmpb $0x0, 0xd(%rsp)
je 0xcd37
movq %rbx, %rdi
callq 0x3190
movw $0x2e, (%rax,%rbx)
leaq 0xd(%rsp), %rdi
callq 0x9ede
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3510
leaq 0x14602(%rip), %rax     # 0x21340
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/xxdp.c
// Function: xxdp_filesystem_print_dir
void xxdp_filesystem_print_dir(xxdp_filesystem_t *_this, FILE *stream) {
	int file_idx;
	// header
	fprintf(stream, "%s\n", xxdp_dir_line(_this, -1));
	fprintf(stream, "\n");
	for (file_idx = 0; file_idx < _this->file_count; file_idx++)
		fprintf(stream, "%s\n", xxdp_dir_line(_this, file_idx));

	fprintf(stream, "\n");
	fprintf(stream, "FREE BLOCKS: %d\n", _this->blockcount - xxdp_bitmap_count(_this));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x7b36(%rip), %rsi      # 0x14d91
leaq 0x83ba(%rip), %rdx      # 0x1561c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3310
pushq $0xa
popq %rdi
movq %rbx, (%rsp)
movq %rbx, %rsi
callq 0x3290
xorl %r13d, %r13d
movslq 0xa8(%r14), %rax
cmpq %rax, %r13
jge 0xd335
movq 0xb0(%r14,%r13,8), %r12
incq %r13
leaq 0x808(%r12), %r15
leaq 0x858(%r12), %rbx
movslq 0x8a0(%r12), %rax
movl 0x89c(%r12), %edx
movl 0x8a4(%r12), %r8d
leaq 0x83f0(%rip), %rsi      # 0x156b8
movslq (%rsi,%rax,4), %rcx
addq %rsi, %rcx
leaq 0x2898a(%rip), %rbp     # 0x35c60
movq %rbp, %rdi
leaq 0x83c9(%rip), %rsi      # 0x156a9
xorl %eax, %eax
callq 0x3530
movl (%r12), %r10d
movzwl 0x4(%r12), %r11d
leaq 0x28918(%rip), %r12     # 0x35c10
movq %r12, %rdi
leaq 0x8359(%rip), %rsi      # 0x1565b
movl %r13d, %edx
movq %r15, %rcx
movq %rbx, %r8
movq %rbp, %r9
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x3530
popq %rcx
popq %rdx
movq (%rsp), %rdi
leaq 0x7a6b(%rip), %rsi      # 0x14d91
movq %r12, %rdx
xorl %eax, %eax
callq 0x3310
jmp 0xd27e
pushq $0xa
popq %rdi
movq (%rsp), %r15
movq %r15, %rsi
callq 0x3290
movl 0x4c(%r14), %ebx
movq %r14, %rdi
callq 0xd373
subl %eax, %ebx
leaq 0x7954(%rip), %rsi      # 0x14cad
movq %r15, %rdi
movl %ebx, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3310
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/xxdp.c
// Function: xxdp_bitmap_count
static int xxdp_bitmap_count(xxdp_filesystem_t *_this) {
	int result = 0;
	unsigned i, j, k;
	for (i = 0; i < _this->bitmap->blocklist.count; i++) {
		xxdp_blocknr_t map_blknr = _this->bitmap->blocklist.blocknr[i];
		unsigned map_wordcount;
		map_wordcount = xxdp_image_get_word(_this, map_blknr, 2);
		for (j = 0; j < map_wordcount; j++) {
			uint16_t map_flags = xxdp_image_get_word(_this, map_blknr, j + 4);
			// 16 flags per word. count "1" bits
			if (map_flags == 0xffff)
				result += 16; // most of time
			else
				for (k = 0; k < 16; k++)
					if (map_flags & (1 << k))
						result++;
		}
	}
	return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r12d, %r12d
xorl %r14d, %r14d
movq 0x90(%rbx), %rax
movl (%rax), %ecx
cmpq %rcx, %r12
jae 0xd3ed
movzwl 0x4(%rax,%r12,2), %r15d
movq %rbx, %rdi
movl %r15d, %esi
pushq $0x2
popq %rdx
callq 0xd832
movzwl %ax, %r13d
xorl %ebp, %ebp
cmpl %r13d, %ebp
je 0xd3e8
leal 0x4(%rbp), %eax
movzbl %al, %edx
movq %rbx, %rdi
movl %r15d, %esi
callq 0xd832
cmpw $-0x1, %ax
je 0xd3e0
movzwl %ax, %eax
xorl %ecx, %ecx
cmpl $0x10, %ecx
je 0xd3e4
btl %ecx, %eax
adcl $0x0, %r14d
incl %ecx
jmp 0xd3d0
addl $0x10, %r14d
incl %ebp
jmp 0xd3af
incq %r12
jmp 0xd387
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/xxdp.c
// Function: xxdp_filename_to_host
char *xxdp_filename_to_host(char *filnam, char *ext) {
	static char result[80];
	char _filnam[80], _ext[80];
	// remove surrounding spaces.
	// all XXDP filename chars are valid host chars (" ", "$", "%")
	// return concat "filnam.ext"
	strcpy(_filnam, strtrim(filnam));
	strcpy(_ext, strtrim(ext));
	if (!strlen(_filnam))
		strcpy(_filnam, "_");
	strcpy(result, _filnam);
	if (strlen(_ext)) {
		strcat(result, ".");
		strcat(result, _ext);
	}
	return result;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %rbx
callq 0x9ede
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x30c0
movq %rbx, %rdi
callq 0x9ede
movq %rsp, %rdi
movq %rax, %rsi
callq 0x30c0
cmpb $0x0, (%r14)
jne 0xd783
movw $0x5f, 0x50(%rsp)
leaq 0x13b66(%rip), %rbx     # 0x212f0
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0x30c0
cmpb $0x0, (%rsp)
je 0xd7b6
movq %rbx, %rdi
callq 0x3190
movw $0x2e, (%rax,%rbx)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x3510
leaq 0x13b33(%rip), %rax     # 0x212f0
addq $0xa8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/xxdp.c
// Function: xxdp_blocklist_get
static int xxdp_blocklist_get(xxdp_filesystem_t *_this, xxdp_blocklist_t *bl,
		xxdp_blocknr_t start) {
	xxdp_blocknr_t blocknr = start;
	unsigned n = 0; // count blocks
	do {
		bl->blocknr[n++] = blocknr;
		// follwo link to next block
		blocknr = xxdp_image_get_word(_this, blocknr, 0);
	} while (n < XXDP_MAX_BLOCKS_PER_LIST && blocknr > 0);
	bl->count = n;
	if (blocknr)
		return error_set(ERROR_FILESYSTEM_FORMAT,
				"xxdp_blocklist_get(): block list too long or recursion");
	return ERROR_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %eax
movq %rsi, %rbx
movq %rdi, %r14
xorl %r15d, %r15d
movq %r15, %r12
incq %r15
movw %ax, 0x4(%rbx,%r12,2)
movzwl %ax, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0xd832
cmpq $0x3fe, %r12            # imm = 0x3FE
ja 0xd802
testw %ax, %ax
jne 0xd7db
movl %r15d, (%rbx)
testw %ax, %ax
je 0xd826
leaq 0x781c(%rip), %rsi      # 0x1502d
pushq $-0x1
popq %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x982c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/xxdp.c
// Function: xxdp_blocklist_set
static void xxdp_blocklist_set(xxdp_filesystem_t *_this, xxdp_blocklist_t *bl) {
	unsigned i;
	for (i = 0; i < (bl->count - 1); i++)
		// write link field of each block with next
		xxdp_image_set_word(_this, bl->blocknr[i], 0, bl->blocknr[i + 1]);
	// clear link field of last block
	xxdp_image_set_word(_this, bl->blocknr[bl->count - 1], 0, 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorl %r15d, %r15d
movl (%r14), %eax
decl %eax
cmpq %rax, %r15
jae 0xd8a3
movzwl 0x4(%r14,%r15,2), %esi
movzwl 0x6(%r14,%r15,2), %ecx
incq %r15
movq %rbx, %rdi
xorl %edx, %edx
callq 0xd8b7
jmp 0xd87e
movzwl 0x4(%r14,%rax,2), %esi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
popq %rbx
popq %r14
popq %r15
jmp 0xd8b7
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/xxdp.c
// Function: xxdp_image_set_word
static void xxdp_image_set_word(xxdp_filesystem_t *_this, xxdp_blocknr_t blocknr,
		uint8_t wordnr, uint16_t val) {
	uint32_t idx = XXDP_BLOCKSIZE * blocknr + (wordnr * 2);
	assert((idx + 1) < _this->image_size);

	_this->image_data[idx] = val & 0xff;
	_this->image_data[idx + 1] = (val >> 8) & 0xff;
	//fprintf(stderr, "set 0x%x to 0x%x\n", idx, val) ;
}

// Assembly:
shll $0x9, %esi
leal (%rsi,%rdx,2), %edx
leaq 0x1(%rdx), %rax
cmpl 0x8(%rdi), %eax
jae 0xd8d3
movq (%rdi), %rsi
movb %cl, (%rsi,%rdx)
movq (%rdi), %rdx
movb %ch, (%rdx,%rax)
retq
pushq %rax
leaq 0x79ed(%rip), %rdi      # 0x152c8
leaq 0x725a(%rip), %rsi      # 0x14b3c
leaq 0x79fd(%rip), %rcx      # 0x152e6
pushq $0x74
popq %rdx
callq 0x3200
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_file_create
rt11_file_t *rt11_file_create() {
	rt11_file_t *file = malloc(sizeof(rt11_file_t));
	file->data = NULL;
	file->dir_ext = NULL;
	file->prefix = NULL;
	file->filnam[0] = 0;
	file->ext[0] = 0;
	file->block_count = 0;
	memset(&file->date, 0, sizeof(struct tm));
	file->fixed = 0;
	file->readonly = 0;
	return file;
}

// Assembly:
pushq %rax
movl $0xd8, %edi
callq 0x33b0
xorl %ecx, %ecx
movb %cl, 0x2(%rax)
movb %cl, 0x52(%rax)
andw $0x0, 0x7c(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x80(%rax)
movups %xmm0, 0x90(%rax)
movups %xmm0, 0xa0(%rax)
movups %xmm0, 0xb0(%rax)
movups %xmm0, 0xc0(%rax)
andq $0x0, 0xd0(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_filesystem_create
rt11_filesystem_t *rt11_filesystem_create(device_type_t dec_device, uint8_t *image_data,
		uint32_t image_size, boolarray_t *changedblocks) {
	int i;
	rt11_filesystem_t *_this;

	_this = malloc(sizeof(rt11_filesystem_t));
	_this->dec_device = dec_device;
	_this->device_info = (device_info_t*) search_tagged_array(device_info_table,
			sizeof(device_info_t), _this->dec_device);
	assert(_this->device_info);

	// Search Random Access Device Information
	_this->radi = (rt11_radi_t*) search_tagged_array(rt11_radi, sizeof(rt11_radi_t),
			_this->dec_device);
	assert(_this->radi);

	// save pointer to variables defining image buffer data
	_this->image_data = image_data;
	_this->image_size = image_size;
	_this->image_changed_blocks = changedblocks;

	// these are always there, static allocated
#ifdef DEFAULTBOOTLOADER
	_this->nobootblock = malloc(sizeof(rt11_stream_t)); // fix bootblock for no bootable volumes
	stream_init(_this->nobootblock);
#endif
	_this->bootblock = malloc(sizeof(rt11_stream_t));
	stream_init(_this->bootblock);
	_this->monitor = malloc(sizeof(rt11_stream_t));
	stream_init(_this->monitor);

	// files vary: dynamic allocate
	_this->file_count = 0;
	for (i = 0; i < RT11_MAX_FILES_PER_IMAGE; i++)
		_this->file[i] = NULL;
	rt11_filesystem_init(_this);
	return _this;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
movl %edi, %r12d
movl $0x1fd8, %edi           # imm = 0x1FD8
callq 0x33b0
movq %rax, %rbx
movl %r12d, 0x18(%rax)
leaq 0xeb49(%rip), %rdi      # 0x1c4b0
pushq $0x20
popq %rsi
movl %r12d, %edx
callq 0xa77f
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0xda17
leaq 0xef3a(%rip), %rdi      # 0x1c8c0
pushq $0xc
popq %rsi
movl %r12d, %edx
callq 0xa77f
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0xda36
movq %r15, (%rbx)
movl %ebp, 0x8(%rbx)
movq %r14, 0x10(%rbx)
pushq $0x68
popq %r14
movq %r14, %rdi
callq 0x33b0
movq %rax, 0x78(%rbx)
andw $0x0, (%rax)
xorl %ebp, %ebp
movb %bpl, 0x14(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
movq %r14, %rdi
callq 0x33b0
andw $0x0, (%rax)
movq %rax, 0x80(%rbx)
movb %bpl, 0x14(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
andl $0x0, 0x8c(%rbx)
pushq $0x12
popq %rax
cmpq $0x3fa, %rax            # imm = 0x3FA
je 0xda03
andq $0x0, (%rbx,%rax,8)
incq %rax
jmp 0xd9f1
movq %rbx, %rdi
callq 0xda55
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6385(%rip), %rdi      # 0x13da3
leaq 0x7d0f(%rip), %rsi      # 0x15734
leaq 0x7d0f(%rip), %rcx      # 0x1573b
movl $0x108, %edx            # imm = 0x108
callq 0x3200
leaq 0x7d5b(%rip), %rdi      # 0x15798
leaq 0x7cf0(%rip), %rsi      # 0x15734
leaq 0x7cf0(%rip), %rcx      # 0x1573b
movl $0x10d, %edx            # imm = 0x10D
callq 0x3200
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_filesystem_destroy
void rt11_filesystem_destroy(rt11_filesystem_t *_this) {
	rt11_filesystem_init(_this); // free files
#ifdef DEFAULTBOOTLOADER
			free(_this->nobootblock);
#endif

	free(_this->bootblock);
	free(_this->monitor);
	free(_this);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0xda55
movq 0x78(%rbx), %rdi
callq 0x3050
movq 0x80(%rbx), %rdi
callq 0x3050
movq %rbx, %rdi
popq %rbx
jmp 0x3050
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/rt11.c
// Function: stream_parse
static void stream_parse(rt11_filesystem_t *_this, rt11_stream_t *stream, rt11_blocknr_t start,
		uint32_t byte_offset, uint32_t data_size) {
	stream->blocknr = start;
	stream->byte_offset = byte_offset;
	stream->data_size = data_size;
	stream->data = malloc(stream->data_size);
	memcpy(stream->data, IMAGE_BLOCKNR2PTR(_this, start) + byte_offset, stream->data_size);
	stream->name[0] = 0; // must be set by caller
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, %ebx
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
movw %r14w, (%rsi)
movl %ecx, 0x4(%rsi)
movl %r8d, 0x10(%rsi)
movl %r8d, %r13d
movq %r13, %rdi
callq 0x33b0
movq %rax, 0x8(%r15)
shll $0x9, %r14d
addq (%r12), %r14
movl %ebx, %esi
addq %r14, %rsi
movq %rax, %rdi
movq %r13, %rdx
callq 0x3340
movb $0x0, 0x14(%r15)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq