LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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
movb $0x0, 0x146bb(%rip)     # 0x1ee90
testl %esi, %esi
jle 0xa8ec
movq %rdi, %rbx
leaq 0x146a9(%rip), %r13     # 0x1ee90
movl %esi, %ebp
leaq 0xe(%rsp), %r15
xorl %r14d, %r14d
movq %r13, %r12
movq %r12, %rax
subq %r13, %rax
cmpq $0x3fb, %rax            # imm = 0x3FB
jge 0xa902
movb (%rbx,%r14), %al
movzbl %al, %ecx
cmpl $0x9, %ecx
jle 0xa837
cmpl $0xa, %ecx
je 0xa852
cmpl $0xd, %ecx
je 0xa864
cmpl $0x20, %ecx
jne 0xa8af
movq %r12, %rdi
callq 0x31a0
movl $0x4350533c, (%r12,%rax) # imm = 0x4350533C
jmp 0xa890
testl %ecx, %ecx
je 0xa880
cmpl $0x7, %ecx
jne 0xa8af
movq %r12, %rdi
callq 0x31a0
movl $0x4c45423c, (%r12,%rax) # imm = 0x4C45423C
jmp 0xa890
movq %r12, %rdi
callq 0x31a0
movl $0x3e464c3c, (%r12,%rax) # imm = 0x3E464C3C
jmp 0xa874
movq %r12, %rdi
callq 0x31a0
movl $0x3e52433c, (%r12,%rax) # imm = 0x3E52433C
movb $0x0, 0x4(%r12,%rax)
addq $0x4, %r12
jmp 0xa89c
movq %r12, %rdi
callq 0x31a0
movl $0x4c554e3c, (%r12,%rax) # imm = 0x4C554E3C
movw $0x3e, 0x4(%r12,%rax)
addq $0x5, %r12
movb $0x0, (%r12)
incq %r14
cmpq %r14, %rbp
jne 0xa7f4
jmp 0xa8ec
leal -0x7f(%rax), %ecx
cmpb $-0x60, %cl
ja 0xa8e3
movsbl %al, %edx
movq %r15, %rdi
leaq 0xaf73(%rip), %rsi      # 0x15837
xorl %eax, %eax
callq 0x3540
movq %r12, %rdi
movq %r15, %rsi
callq 0x3520
movq %r15, %rdi
callq 0x31a0
addq %rax, %r12
jmp 0xa89c
movb %al, (%r12)
incq %r12
jmp 0xa89c
leaq 0x1459d(%rip), %rax     # 0x1ee90
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xaed0(%rip), %rdi      # 0x157d9
leaq 0xaeab(%rip), %rsi      # 0x157bb
leaq 0xaee4(%rip), %rcx      # 0x157fb
movl $0xe0, %edx
callq 0x3210
// File: /workspace/github_c_makefile_star2_O1/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:
imull $0xcccd, %edi, %edx     # imm = 0xCCCD
shrl $0x15, %edx
leal (,%rdx,8), %eax
leal (%rax,%rax,4), %eax
movl %edi, %ecx
subl %eax, %ecx
movw $0x20, %ax
movw $0x20, %si
testw %cx, %cx
je 0xa981
movzwl %cx, %esi
cmpw $0x1a, %cx
ja 0xa953
orl $0x40, %esi
jmp 0xa981
leal -0x1b(%rsi), %ecx
cmpw $0x3, %cx
jae 0xa96e
shll $0x4, %ecx
movabsq $0x25002e0024, %rsi     # imm = 0x25002E0024
shrq %cl, %rsi
jmp 0xa981
leal -0x1e(%rsi), %ecx
addl $0x12, %esi
cmpl $0xa, %ecx
movl $0x25, %ecx
cmovbl %esi, %ecx
movl %ecx, %esi
movb %sil, 0x1490a(%rip)     # 0x1f292
movzwl %dx, %ecx
imull $0x667, %ecx, %edx      # imm = 0x667
shrl $0xd, %edx
andl $-0x8, %edx
leal (%rdx,%rdx,4), %edx
subl %edx, %ecx
testw %cx, %cx
je 0xa9dd
movzwl %cx, %eax
cmpw $0x1a, %cx
ja 0xa9af
orl $0x40, %eax
jmp 0xa9dd
leal -0x1b(%rax), %ecx
cmpw $0x3, %cx
jae 0xa9ca
shll $0x4, %ecx
movabsq $0x25002e0024, %rax     # imm = 0x25002E0024
shrq %cl, %rax
jmp 0xa9dd
leal -0x1e(%rax), %ecx
addl $0x12, %eax
cmpl $0xa, %ecx
movl $0x25, %ecx
cmovbl %eax, %ecx
movl %ecx, %eax
movb %al, 0x148ae(%rip)      # 0x1f291
movzwl %di, %ecx
movw $0x20, %ax
cmpl $0x640, %ecx            # imm = 0x640
jb 0xaa3e
movl %ecx, %eax
shrl $0x6, %eax
imull $0xa3e, %eax, %eax      # imm = 0xA3E
shrl $0x10, %eax
cmpl $0xa8bf, %ecx           # imm = 0xA8BF
ja 0xaa0d
orl $0x40, %eax
jmp 0xaa3e
leal -0x1b(%rax), %ecx
cmpw $0x3, %cx
jae 0xaa2b
movswl %cx, %ecx
shll $0x4, %ecx
movabsq $0x25002e0024, %rax     # imm = 0x25002E0024
shrq %cl, %rax
jmp 0xaa3e
leal -0x1e(%rax), %ecx
addl $0x12, %eax
cmpl $0xa, %ecx
movl $0x25, %ecx
cmovbl %eax, %ecx
movl %ecx, %eax
movb %al, 0x1484c(%rip)      # 0x1f290
leaq 0x14845(%rip), %rax     # 0x1f290
movb $0x0, 0x14841(%rip)     # 0x1f293
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xaa8c
movq %rdi, %rbx
callq 0x31a0
movq %rax, %r14
testl %r14d, %r14d
jle 0xaa90
callq 0x3030
movq (%rax), %rax
movsbq (%rbx), %rcx
movl (%rax,%rcx,4), %edi
callq 0xaae3
shll $0x3, %eax
leal (%rax,%rax,4), %r15d
jmp 0xaa93
xorl %ebp, %ebp
jmp 0xaad6
xorl %r15d, %r15d
cmpl $0x2, %r14d
jl 0xaab1
callq 0x3030
movq (%rax), %rax
movsbq 0x1(%rbx), %rcx
movl (%rax,%rcx,4), %edi
callq 0xaae3
addl %eax, %r15d
shll $0x3, %r15d
leal (%r15,%r15,4), %ebp
cmpl $0x3, %r14d
jl 0xaad6
callq 0x3030
movq (%rax), %rax
movsbq 0x2(%rbx), %rcx
movl (%rax,%rcx,4), %edi
callq 0xaae3
addl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xaaeb
retq
leal -0x41(%rdi), %eax
cmpl $0x19, %eax
ja 0xaaf9
addl $-0x40, %edi
movl %edi, %eax
retq
cmpl $0x24, %edi
je 0xab14
cmpl $0x25, %edi
je 0xab0e
cmpl $0x2e, %edi
jne 0xab1a
movl $0x1c, %eax
retq
movl $0x1d, %eax
retq
movl $0x1b, %eax
retq
leal -0x30(%rdi), %eax
addl $-0x12, %edi
cmpl $0xa, %eax
movl $0x1d, %eax
cmovbl %edi, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xab5b
movq %rdi, %rdx
cmpb $0x0, (%rdi)
je 0xab5b
leaq 0xa8fd(%rip), %rsi      # 0x15447
leaq 0x90(%rsp), %rdi
xorl %eax, %eax
callq 0x3540
jmp 0xab6b
leaq 0x90(%rsp), %rdi
movq %rcx, %rsi
callq 0x30d0
leaq 0x90(%rsp), %rdi
movq %rsp, %rsi
callq 0x3330
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movl %ecx, %eax
addq $0x1098, %rsp           # imm = 0x1098
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xab9c
testl %ecx, %ecx
jne 0xab9f
jmp 0xaba4
movq %rdi, %rax
incq %rdi
jmp 0xab8e
testq %rax, %rax
je 0xabb4
testl %esi, %esi
je 0xabb0
movb $0x0, (%rax)
incq %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rax
movl %esi, %eax
imulq $0x418938, %rax, %rcx   # imm = 0x418938
shrq $0x20, %rcx
leal 0x7b2(%rcx), %edx
imull $0x3e8, %ecx, %r8d      # imm = 0x3E8
movl %esi, %eax
subl %r8d, %eax
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq $0x0, 0x30(%rdi)
testb $0x3, %dl
jne 0xac63
imulq $0x28f5c29, %rdx, %r8   # imm = 0x28F5C29
shrq $0x20, %r8
imull $0x64, %r8d, %r8d
negl %r8d
addl %ecx, %r8d
addl $0x7b2, %r8d            # imm = 0x7B2
testl %r8d, %r8d
je 0xac63
leaq 0x1181f(%rip), %r9      # 0x1c480
jmp 0xac87
imull $0xc28f5c29, %edx, %r8d # imm = 0xC28F5C29
rorl $0x4, %r8d
cmpl $0xa3d70b, %r8d         # imm = 0xA3D70B
leaq 0x11804(%rip), %r8      # 0x1c480
leaq 0x117cd(%rip), %r9      # 0x1c450
cmovbq %r8, %r9
movl (%r9), %r10d
cmpl %r10d, %eax
jle 0xaca7
xorl %r8d, %r8d
subl %r10d, %eax
movl 0x4(%r9,%r8,4), %r10d
incq %r8
cmpl %r10d, %eax
jg 0xac92
movl %r8d, %r10d
jmp 0xacad
xorl %r10d, %r10d
xorl %r8d, %r8d
leal 0x46(%rcx), %r9d
movl %r9d, 0x14(%rdi)
movl %r10d, 0x10(%rdi)
movl %eax, 0xc(%rdi)
testb $0x3, %r9b
jne 0xacea
imulq $0x28f5c29, %rdx, %r11  # imm = 0x28F5C29
shrq $0x20, %r11
imull $0x64, %r11d, %r11d
negl %r11d
addl %r11d, %ecx
addl $0x7b2, %ecx            # imm = 0x7B2
testl %ecx, %ecx
je 0xacea
leaq 0x11798(%rip), %rcx     # 0x1c480
jmp 0xad0b
imull $0xc28f5c29, %edx, %ecx # imm = 0xC28F5C29
rorl $0x4, %ecx
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
leaq 0x11780(%rip), %rdx     # 0x1c480
leaq 0x11749(%rip), %rcx     # 0x1c450
cmovbq %rdx, %rcx
testl %r10d, %r10d
je 0xad23
xorl %r10d, %r10d
xorl %edx, %edx
addl (%rcx,%r10,4), %edx
incq %r10
cmpq %r10, %r8
jne 0xad15
jmp 0xad25
xorl %edx, %edx
imull $0x3e8, %r9d, %ecx      # imm = 0x3E8
addl %eax, %ecx
leal (%rdx,%rcx), %eax
addl $0xffffee90, %eax       # imm = 0xFFFFEE90
cmpw %si, %ax
jne 0xad40
movq %rdi, %rax
popq %rcx
retq
leaq 0xaaf7(%rip), %rdi      # 0x1583e
leaq 0xaa6d(%rip), %rsi      # 0x157bb
leaq 0xab07(%rip), %rcx      # 0x1585c
movl $0x181, %edx            # imm = 0x181
callq 0x3210
// File: /workspace/github_c_makefile_star2_O1/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:
leaq 0x8(%rsp), %rax
movl 0x14(%rax), %ecx
leal 0x76c(%rcx), %edx
testb $0x3, %cl
jne 0xada3
movslq %edx, %rsi
imulq $0x51eb851f, %rsi, %rsi # imm = 0x51EB851F
movq %rsi, %rdi
shrq $0x3f, %rdi
sarq $0x25, %rsi
addl %edi, %esi
imull $0x64, %esi, %esi
negl %esi
addl %ecx, %esi
addl $0x76c, %esi            # imm = 0x76C
testl %esi, %esi
je 0xada3
leaq 0x116df(%rip), %rdx     # 0x1c480
jmp 0xadca
imull $0xc28f5c29, %edx, %edx # imm = 0xC28F5C29
addl $0x51eb850, %edx        # imm = 0x51EB850
rorl $0x4, %edx
cmpl $0xa3d70b, %edx         # imm = 0xA3D70B
leaq 0x116c1(%rip), %rsi     # 0x1c480
leaq 0x1168a(%rip), %rdx     # 0x1c450
cmovbq %rsi, %rdx
movslq 0x10(%rax), %rdi
testq %rdi, %rdi
jle 0xade6
xorl %r8d, %r8d
xorl %esi, %esi
addl (%rdx,%r8,4), %esi
incq %r8
cmpq %r8, %rdi
jne 0xadd8
jmp 0xade8
xorl %esi, %esi
movl 0xc(%rax), %eax
imull $0x3e8, %ecx, %ecx      # imm = 0x3E8
addl %esi, %ecx
addl %ecx, %eax
addl $0xffffee90, %eax       # imm = 0xFFFFEE90
retq
// File: /workspace/github_c_makefile_star2_O1/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 %rdx, %rdi
callq 0x31a0
cmpq $0x2f, %rax
ja 0xb09e
movq %r15, %rdi
callq 0x31a0
movw $0x20, (%r15,%rax)
movq %r15, %rdi
callq 0x31a0
cmpq $0x30, %rax
jb 0xb081
movq %r14, %rdi
callq 0x31a0
cmpq $0x27, %rax
ja 0xb0c9
movq %r14, %rdi
callq 0x31a0
movw $0x20, (%r14,%rax)
movq %r14, %rdi
callq 0x31a0
cmpq $0x28, %rax
jb 0xb0ac
movq %rbx, %rdi
callq 0x31a0
cmpq $0xf, %rax
ja 0xb0f3
movq %rbx, %rdi
callq 0x31a0
movw $0x20, (%rbx,%rax)
movq %rbx, %rdi
callq 0x31a0
cmpq $0x10, %rax
jb 0xb0d7
leaq 0xa791(%rip), %rsi      # 0x1588b
xorl %r13d, %r13d
movq %r12, %rdi
movl %ebp, %edx
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x3320
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_O1/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
movl $0x10, %edi
callq 0x33c0
movq %rax, %r14
movl %ebx, 0x8(%rax)
shrl $0x5, %ebx
incl %ebx
movq %rbx, %rdi
callq 0x33c0
movq %rax, (%r14)
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x3230
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xb1e3
movq (%rdi), %rax
movl %esi, %edx
movl $0x1, %edi
movl %esi, %ecx
shll %cl, %edi
shrl $0x5, %edx
orl %edi, (%rax,%rdx,4)
retq
pushq %rax
leaq 0xa6b2(%rip), %rdi      # 0x1589d
leaq 0xa6bf(%rip), %rsi      # 0x158b1
leaq 0xa6c4(%rip), %rcx      # 0x158bd
movl $0x40, %edx
callq 0x3210
// File: /workspace/github_c_makefile_star2_O1/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 0xb21d
movq (%rdi), %rax
movl %esi, %edx
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
movl %esi, %ecx
roll %cl, %edi
shrl $0x5, %edx
andl %edi, (%rax,%rdx,4)
retq
pushq %rax
leaq 0xa678(%rip), %rdi      # 0x1589d
leaq 0xa685(%rip), %rsi      # 0x158b1
leaq 0xa6ba(%rip), %rcx      # 0x158ed
movl $0x47, %edx
callq 0x3210
// File: /workspace/github_c_makefile_star2_O1/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, %rbx
movq %rdi, %r15
testl %edx, %edx
je 0xb294
movl %edx, %r12d
cmpl %edx, 0x8(%r15)
jae 0xb298
movl 0x8(%r15), %r12d
leal -0x1(%r12), %r8d
leaq 0xa6aa(%rip), %rsi      # 0x1594e
movq %rbx, %rdi
movq %rcx, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x3320
cmpl $0x1, %r12d
jb 0xb3b8
movq %rbx, (%rsp)
xorl %r14d, %r14d
xorl %ebp, %ebp
movq %r15, %rdi
movl %r14d, %esi
callq 0xb23d
movb $0x1, %bl
testl %eax, %eax
je 0xb2dd
movl %r14d, %r13d
jmp 0xb2fe
incl %r14d
movl %r14d, %r13d
cmpl %r12d, %r14d
setb %bl
jae 0xb2fe
movq %r15, %rdi
movl %r13d, %esi
callq 0xb23d
leal 0x1(%r13), %r14d
testl %eax, %eax
je 0xb2e0
movl %r13d, %r14d
cmpl %r12d, %r13d
jae 0xb323
movl %r13d, %r14d
movq %r15, %rdi
movl %r14d, %esi
callq 0xb23d
testl %eax, %eax
je 0xb323
incl %r14d
cmpl %r14d, %r12d
jne 0xb309
movl %r12d, %r14d
testb %bl, %bl
je 0xb399
testl %ebp, %ebp
je 0xb33e
movl $0x2c, %edi
movq (%rsp), %rbx
movq %rbx, %rsi
callq 0x32a0
jmp 0xb35b
movl $0xb, %esi
movl $0x1, %edx
leaq 0xa627(%rip), %rdi      # 0x15976
movq (%rsp), %rbx
movq %rbx, %rcx
callq 0x3560
movl %r14d, %eax
subl %r13d, %eax
cmpl $0x2, %eax
jb 0xb380
leal -0x1(%r14), %ecx
movq %rbx, %rdi
leaq 0xa60e(%rip), %rsi      # 0x15982
movl %r13d, %edx
xorl %eax, %eax
callq 0x3320
jmp 0xb394
movq %rbx, %rdi
leaq 0xac55(%rip), %rsi      # 0x15fdf
movl %r13d, %edx
xorl %eax, %eax
callq 0x3320
movl $0x1, %ebp
cmpl %r12d, %r14d
jb 0xb2c7
testl %ebp, %ebp
movq (%rsp), %rbx
je 0xb3b8
leaq 0x7037(%rip), %rdi      # 0x123e8
movl $0x2, %esi
jmp 0xb3c4
leaq 0xa5c9(%rip), %rdi      # 0x15988
movl $0xd, %esi
movl $0x1, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3560
nop
// File: /workspace/github_c_makefile_star2_O1/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
movl $0x20, %edi
callq 0x33c0
movq %rax, %rbx
movl %r13d, (%rax)
movl %r14d, 0x4(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
cmpl $0x2, %r13d
je 0xb749
cmpl $0x1, %r13d
jne 0xb76a
movl %r12d, %edi
movq %r15, %rsi
movl %ebp, %edx
movq (%rsp), %rcx
callq 0xbdcc
movq %rax, 0x8(%rbx)
addq $0xa8, %rax
jmp 0xb764
movl %r12d, %edi
movq %r15, %rsi
movl %ebp, %edx
movq (%rsp), %rcx
callq 0xe66c
movq %rax, 0x10(%rbx)
addq $0x8c, %rax
movq %rax, 0x18(%rbx)
jmp 0xb78a
leaq 0x12acf(%rip), %rax     # 0x1e240
movq (%rax), %rcx
leaq 0xa235(%rip), %rdi      # 0x159b0
movl $0x21, %esi
movl $0x1, %edx
callq 0x3560
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_O1/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 0xb7b7
cmpl $0x1, %eax
jne 0xb7c2
movq 0x8(%rbx), %rdi
callq 0xc150
jmp 0xb7e2
movq 0x10(%rbx), %rdi
callq 0xe8dd
jmp 0xb7e2
leaq 0x12a77(%rip), %rax     # 0x1e240
movq (%rax), %rcx
leaq 0xa1ff(%rip), %rdi      # 0x159d2
movl $0x27, %esi
movl $0x1, %edx
callq 0x3560
movq %rbx, %rdi
popq %rbx
jmp 0x3050
// File: /workspace/github_c_makefile_star2_O1/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 0xb800
cmpl $0x1, %eax
jne 0xb809
movq 0x8(%rdi), %rdi
jmp 0xbfed
movq 0x10(%rdi), %rdi
jmp 0xe781
leaq 0x12a30(%rip), %rax     # 0x1e240
movq (%rax), %rcx
leaq 0xa1e0(%rip), %rdi      # 0x159fa
movl $0x1f, %esi
movl $0x1, %edx
jmp 0x3560
// File: /workspace/github_c_makefile_star2_O1/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 0xb83e
cmpl $0x1, %eax
jne 0xb847
movq 0x8(%rdi), %rdi
jmp 0xc19e
movq 0x10(%rdi), %rdi
jmp 0xe904
leaq 0xa1cc(%rip), %rsi      # 0x15a1a
movl $0xfffffffc, %edi       # imm = 0xFFFFFFFC
xorl %eax, %eax
jmp 0x9f8f
// File: /workspace/github_c_makefile_star2_O1/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 0xb8a3
cmpl $0x1, %eax
jne 0xb8ec
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 0xd483
movl %ecx, 0xc(%rsp)
movq %r8, 0x10(%rsp)
xorl %r12d, %r12d
movq %r15, %rdi
xorl %esi, %esi
callq 0xab8c
testq %rax, %rax
je 0xb91d
movq %rax, %rbx
leaq 0xa16b(%rip), %rsi      # 0x15a33
movq %rax, %rdi
callq 0x3060
testl %eax, %eax
je 0xb90d
leaq 0xa15f(%rip), %rsi      # 0x15a3a
movq %rbx, %rdi
callq 0x3060
testl %eax, %eax
je 0xb90d
xorl %r12d, %r12d
jmp 0xb91d
leaq 0xa127(%rip), %rsi      # 0x15a1a
movl $0xfffffffc, %edi       # imm = 0xFFFFFFFC
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9f8f
movq %r15, %rdi
movl $0x1, %esi
callq 0xab8c
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 0xf7f3
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xbbd9
cmpl $0x1, %eax
jne 0xbbe2
movq 0x8(%rdi), %rdi
jmp 0xc97d
movq 0x10(%rdi), %rdi
jmp 0xf244
leaq 0x9e31(%rip), %rsi      # 0x15a1a
movl $0xfffffffc, %edi       # imm = 0xFFFFFFFC
xorl %eax, %eax
jmp 0x9f8f
// File: /workspace/github_c_makefile_star2_O1/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 0x107ba(%rip), %rdi     # 0x1c4c0
movl $0x20, %esi
callq 0xb12a
testq %rax, %rax
je 0xbd1b
movq 0x8(%rax), %rax
jmp 0xbd1d
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl 0x10797(%rip), %ebp     # 0x1c4c0
testl %ebp, %ebp
je 0xbd64
movq %rdi, %rbx
movq 0x10791(%rip), %rsi     # 0x1c4c8
callq 0x3060
testl %eax, %eax
je 0xbd66
leaq 0x107a1(%rip), %r14     # 0x1c4e8
movl -0x8(%r14), %ebp
testl %ebp, %ebp
je 0xbd64
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x3060
addq $0x20, %r14
testl %eax, %eax
jne 0xbd47
jmp 0xbd66
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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:
movb $0x0, 0x1371c(%rip)     # 0x1f490
cmpl $0x0, 0x10745(%rip)     # 0x1c4c0
je 0xbdc3
pushq %r14
pushq %rbx
pushq %rax
leaq 0x10758(%rip), %r14     # 0x1c4e0
leaq 0x13701(%rip), %rbx     # 0x1f490
cmpb $0x0, 0x136fa(%rip)     # 0x1f490
je 0xbda6
movq %rbx, %rdi
callq 0x31a0
movw $0x2c, (%rax,%rbx)
movq -0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x3520
cmpl $0x0, (%r14)
leaq 0x20(%r14), %r14
jne 0xbd8f
addq $0x8, %rsp
popq %rbx
popq %r14
leaq 0x136c6(%rip), %rax     # 0x1f490
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0xbfed
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_O1/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 $0x1018, %rsp           # imm = 0x1018
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rsi
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x30d0
leaq 0x84d4(%rip), %r12      # 0x15d86
movzbl (%r15), %eax
movb $0x20, %cl
cmpl $0x5f, %eax
je 0xd8f1
testl %eax, %eax
je 0xd8f9
movsbq %al, %r13
callq 0x3030
movq (%rax), %rax
movl (%rax,%r13,4), %ebp
movb %bpl, (%r15)
movsbl %bpl, %esi
movl $0x29, %edx
movq %r12, %rdi
callq 0x32b0
movl $0x25, %ecx
testq %rax, %rax
je 0xd8f1
movl %ebp, %ecx
movb %cl, (%r15)
incq %r15
jmp 0xd8b2
leaq 0x10(%rsp), %rdi
movl $0x1, %esi
callq 0xab8c
leaq 0x5(%rsp), %rcx
testq %rax, %rax
je 0xd936
movb (%rax), %dl
testb %dl, %dl
je 0xd936
movl $0x1, %esi
movb %dl, (%rcx)
incq %rcx
movb (%rax,%rsi), %dl
testb %dl, %dl
je 0xd936
leaq 0x1(%rsi), %rdi
cmpq $0x3, %rsi
movq %rdi, %rsi
jl 0xd91d
movb $0x0, (%rcx)
movb 0x10(%rsp), %al
testb %al, %al
je 0xd962
xorl %ecx, %ecx
movb %al, 0x9(%rsp,%rcx)
movb 0x11(%rsp,%rcx), %al
incq %rcx
testb %al, %al
je 0xd958
cmpq $0x6, %rcx
jl 0xd943
leaq (%rsp,%rcx), %rax
addq $0x9, %rax
jmp 0xd967
leaq 0x9(%rsp), %rax
movb $0x0, (%rax)
testq %r14, %r14
je 0xd984
leaq 0x9(%rsp), %rdi
callq 0xa6d4
movq %r14, %rdi
movq %rax, %rsi
callq 0x30d0
testq %rbx, %rbx
je 0xd99e
leaq 0x5(%rsp), %rdi
callq 0xa6d4
movq %rbx, %rdi
movq %rax, %rsi
callq 0x30d0
leaq 0x9(%rsp), %rdi
callq 0xa6d4
leaq 0x139a1(%rip), %rbx     # 0x21350
movq %rbx, %rdi
movq %rax, %rsi
callq 0x30d0
cmpb $0x0, 0x5(%rsp)
je 0xd9e4
movq %rbx, %rdi
callq 0x31a0
movw $0x2e, (%rax,%rbx)
leaq 0x5(%rsp), %rdi
callq 0xa6d4
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3520
leaq 0x13965(%rip), %rax     # 0x21350
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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, %r15
movq %rdi, %r14
leaq 0x7e14(%rip), %rsi      # 0x15d46
leaq 0x8698(%rip), %rdx      # 0x165d1
movq %r15, %rdi
xorl %eax, %eax
callq 0x3320
movl $0xa, %edi
movq %r15, %rsi
callq 0x32a0
cmpl $0x0, 0xa8(%r14)
jle 0xe01c
xorl %ebp, %ebp
movq %r15, %r13
movq 0xb0(%r14,%rbp,8), %r15
incq %rbp
leaq 0x808(%r15), %r12
leaq 0x858(%r15), %rax
movq %rax, (%rsp)
movslq 0x8a0(%r15), %rax
movl 0x89c(%r15), %edx
movl 0x8a4(%r15), %r8d
leaq 0x86d0(%rip), %rsi      # 0x1666c
movslq (%rsi,%rax,4), %rcx
addq %rsi, %rcx
movq %r14, %rbx
leaq 0x27cc3(%rip), %r14     # 0x35c70
movq %r14, %rdi
leaq 0x86a7(%rip), %rsi      # 0x1665e
xorl %eax, %eax
callq 0x3540
movl (%r15), %r10d
movzwl 0x4(%r15), %r11d
movq %r13, %r15
leaq 0x27c50(%rip), %r13     # 0x35c20
movq %r13, %rdi
leaq 0x8636(%rip), %rsi      # 0x16610
movl %ebp, %edx
movq %r12, %rcx
movq (%rsp), %r8
movq %r14, %r9
movq %rbx, %r14
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x3540
addq $0x10, %rsp
movq %r15, %rdi
leaq 0x7d44(%rip), %rsi      # 0x15d46
movq %r13, %rdx
xorl %eax, %eax
callq 0x3320
movslq 0xa8(%rbx), %rax
cmpq %rax, %rbp
jl 0xdf60
movl $0xa, %edi
movq %r15, %rsi
callq 0x32a0
movl 0x4c(%r14), %ebx
movq %r14, %rdi
callq 0xe058
subl %eax, %ebx
leaq 0x7c24(%rip), %rsi      # 0x15c62
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 0x3320
// File: /workspace/github_c_makefile_star2_O1/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 0x90(%rdi), %rax
cmpl $0x0, (%rax)
je 0xe0e3
movq %rdi, %rbx
xorl %r15d, %r15d
xorl %ebp, %ebp
movzwl 0x4(%rax,%r15,2), %r14d
movq %rbx, %rdi
movl %r14d, %esi
movl $0x2, %edx
callq 0xe556
testw %ax, %ax
je 0xe0d0
movzwl %ax, %r12d
xorl %r13d, %r13d
leal 0x4(%r13), %eax
movzbl %al, %edx
movq %rbx, %rdi
movl %r14d, %esi
callq 0xe556
cmpw $-0x1, %ax
je 0xe0c5
movzwl %ax, %eax
xorl %ecx, %ecx
btl %ecx, %eax
adcl $0x0, %ebp
incl %ecx
cmpl $0x10, %ecx
jne 0xe0b6
jmp 0xe0c8
addl $0x10, %ebp
incl %r13d
cmpl %r12d, %r13d
jne 0xe099
incq %r15
movq 0x90(%rbx), %rax
movl (%rax), %ecx
cmpq %rcx, %r15
jb 0xe077
jmp 0xe0e5
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xa6d4
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x30d0
movq %rbx, %rdi
callq 0xa6d4
movq %rsp, %rdi
movq %rax, %rsi
callq 0x30d0
cmpb $0x0, (%r14)
jne 0xe4a5
movw $0x5f, 0x50(%rsp)
leaq 0x12e54(%rip), %rbx     # 0x21300
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0x30d0
cmpb $0x0, (%rsp)
je 0xe4d8
movq %rbx, %rdi
callq 0x31a0
movw $0x2e, (%rax,%rbx)
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x3520
leaq 0x12e21(%rip), %rax     # 0x21300
addq $0xa8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xe556
cmpq $0x3fe, %r12            # imm = 0x3FE
ja 0xe524
testw %ax, %ax
jne 0xe4fd
movl %r15d, (%rbx)
testw %ax, %ax
je 0xe54a
leaq 0x7aaf(%rip), %rsi      # 0x15fe2
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x9f8f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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
movl (%rsi), %eax
decl %eax
je 0xe5cd
xorl %r15d, %r15d
movzwl 0x4(%r14,%r15,2), %esi
movzwl 0x6(%r14,%r15,2), %ecx
incq %r15
movq %rbx, %rdi
xorl %edx, %edx
callq 0xe5e3
movl (%r14), %eax
decl %eax
cmpq %rax, %r15
jb 0xe5aa
movl %eax, %eax
movzwl 0x4(%r14,%rax,2), %esi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
popq %rbx
popq %r14
popq %r15
jmp 0xe5e3
// File: /workspace/github_c_makefile_star2_O1/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 0xe5ff
movq (%rdi), %rsi
movb %cl, (%rsi,%rdx)
movq (%rdi), %rdx
movb %ch, (%rdx,%rax)
retq
pushq %rax
leaq 0x7c76(%rip), %rdi      # 0x1627d
leaq 0x74e3(%rip), %rsi      # 0x15af1
leaq 0x7c86(%rip), %rcx      # 0x1629b
movl $0x74, %edx
callq 0x3210
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x33c0
xorl %ecx, %ecx
movb %cl, 0x2(%rax)
movb %cl, 0x52(%rax)
movw $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)
movq $0x0, 0xd0(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x33c0
movq %rax, %rbx
movl %r12d, 0x18(%rax)
leaq 0xde29(%rip), %rdi      # 0x1c4c0
movl $0x20, %esi
movl %r12d, %edx
callq 0xb12a
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0xe743
leaq 0xe218(%rip), %rdi      # 0x1c8d0
movl $0xc, %esi
movl %r12d, %edx
callq 0xb12a
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0xe762
movq %r15, (%rbx)
movl %ebp, 0x8(%rbx)
movq %r14, 0x10(%rbx)
movl $0x68, %edi
callq 0x33c0
movq %rax, 0x78(%rbx)
xorl %ebp, %ebp
movw %bp, (%rax)
movb %bpl, 0x14(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
movl $0x68, %edi
callq 0x33c0
movq %rax, 0x80(%rbx)
movw %bp, (%rax)
movb %bpl, 0x14(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rax)
movq %rbx, %rdi
addq $0x8c, %rdi
movl $0x1f44, %edx           # imm = 0x1F44
xorl %esi, %esi
callq 0x3230
movq %rbx, %rdi
callq 0xe781
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6671(%rip), %rdi      # 0x14dbb
leaq 0x7f97(%rip), %rsi      # 0x166e8
leaq 0x7f97(%rip), %rcx      # 0x166ef
movl $0x108, %edx            # imm = 0x108
callq 0x3210
leaq 0x7fe3(%rip), %rdi      # 0x1674c
leaq 0x7f78(%rip), %rsi      # 0x166e8
leaq 0x7f78(%rip), %rcx      # 0x166ef
movl $0x10d, %edx            # imm = 0x10D
callq 0x3210
// File: /workspace/github_c_makefile_star2_O1/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 0xe781
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_O1/j-hoppe[P]tu58fs/rt11.c
// Function: patch_dd_sys
static int patch_dd_sys(rt11_filesystem_t *_this, char *filnam, char*ext,
		rt11_blocknr_t blockcount) {
	rt11_file_t *f;
	f = rt11_filesystem_file_by_name(_this, filnam, ext);

	if (f) {
		if (f->block_count < 4) // is 5
			return error_set(ERROR_FILESYSTEM_FORMAT, "DD.SYS < 4 blocks");
		// patch position in image: startblock of file + offset
		// lsb at offset 0x2c, msb at offset 0x2d
		rt11_image_set_word_at(_this, f->block_nr, 0x2c, blockcount);
		/*
		 // debug: make file visible
		 {
		 char pathbuff[4096];
		 sprintf(pathbuff, "dbg_%s", rt11_filename_to_host(filnam, ext, NULL));
		 // works only because file is plain stream in image
		 file_write(pathbuff, f->data->data, f->data->data_size);
		 }
		 */
	}
	return ERROR_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, 0x4(%rsp)
movq %rdi, %r14
movslq 0x8c(%rdi), %r13
testq %r13, %r13
jle 0xf791
movq %rsi, %r15
leaq 0x6f45(%rip), %r12      # 0x166a4
xorl %ebx, %ebx
movq 0x90(%r14,%rbx,8), %rbp
leaq 0x2(%rbp), %rsi
movq %r15, %rdi
callq 0x3060
testl %eax, %eax
jne 0xf789
leaq 0x52(%rbp), %rsi
movq %r12, %rdi
callq 0x3060
testl %eax, %eax
je 0xf793
incq %rbx
cmpq %rbx, %r13
jne 0xf761
xorl %ebp, %ebp
testq %rbp, %rbp
je 0xf7c0
cmpw $0x3, 0x7c(%rbp)
ja 0xf7cf
leaq 0x7462(%rip), %rsi      # 0x16c08
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9f8f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzwl 0x7a(%rbp), %esi
movzwl 0x4(%rsp), %ecx
movq %r14, %rdi
movl $0x2c, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10860
// File: /workspace/github_c_makefile_star2_O1/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_filesystem_print_dir
void rt11_filesystem_print_dir(rt11_filesystem_t *_this, FILE *stream) {
	int fileidx;
	char line[80];
	// no header
	line[0] = 0;
	for (fileidx = 0; fileidx < _this->file_count; fileidx++) {
		if (fileidx & 1) {
			// odd file #: right column, print
			strcat(line, "      ");
			strcat(line, rt11_dir_entry_text(_this, fileidx));
			fprintf(stream, "%s\n", line);
			line[0] = 0;
		} else {
			// even: left column
			strcpy(line, rt11_dir_entry_text(_this, fileidx));
		}
	}
	if (strlen(line)) // print pending left column
		fprintf(stream, "%s\n", line);
	fprintf(stream, " %d files, %d blocks\n", _this->file_count, _this->used_file_blocks);
	fprintf(stream, " %d Free blocks\n", _this->free_blocks);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movb $0x0, (%rsp)
cmpl $0x0, 0x8c(%rdi)
jle 0x105ef
leaq 0x3a365(%rip), %r15     # 0x4a8e0
movq %rsp, %r12
leaq 0x57c1(%rip), %r13      # 0x15d46
xorl %ebp, %ebp
testb $0x1, %bpl
jne 0x105a4
movq %r14, %rdi
movl %ebp, %esi
callq 0x10651
movq %r12, %rdi
movq %r15, %rsi
callq 0x30d0
jmp 0x105e4
movq %r12, %rdi
callq 0x31a0
movl $0x20202020, (%rsp,%rax) # imm = 0x20202020
movl $0x202020, 0x3(%rsp,%rax) # imm = 0x202020
movq %r14, %rdi
movl %ebp, %esi
callq 0x10651
movq %r12, %rdi
movq %r15, %rsi
callq 0x3520
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3320
movb $0x0, (%rsp)
incl %ebp
cmpl 0x8c(%r14), %ebp
jl 0x10587
cmpb $0x0, (%rsp)
je 0x10609
leaq 0x574a(%rip), %rsi      # 0x15d46
movq %rsp, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3320
movl 0x8c(%r14), %edx
movzwl 0x1fd0(%r14), %ecx
leaq 0x6244(%rip), %rsi      # 0x16863
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3320
movzwl 0x1fd2(%r14), %edx
leaq 0x6241(%rip), %rsi      # 0x16879
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3320
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_dir_entry_text
static char *rt11_dir_entry_text(rt11_filesystem_t *_this, int fileidx) {
	static char buff[80];
	rt11_file_t *f = _this->file[fileidx];
	sprintf(buff, "%6s.%-3s%6d%c %s", f->filnam, f->ext, f->block_count,
			f->readonly ? 'P' : ' ', rt11_date_text(f->date));
	return buff;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movslq %esi, %rax
movq 0x90(%rdi,%rax,8), %rax
leaq 0x2(%rax), %rbx
leaq 0x52(%rax), %r14
movzwl 0x7c(%rax), %ebp
cmpl $0x0, 0xd0(%rax)
movl $0x20, %ecx
movl $0x50, %r15d
cmovel %ecx, %r15d
movslq 0xa8(%rax), %rcx
movl 0xa4(%rax), %edx
movl 0xac(%rax), %r8d
leaq 0x6957(%rip), %rax      # 0x16ffc
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
leaq 0x3a27d(%rip), %r12     # 0x4a930
leaq 0x5fa4(%rip), %rsi      # 0x1665e
movq %r12, %rdi
xorl %eax, %eax
callq 0x3540
movq %r12, (%rsp)
leaq 0x3a211(%rip), %rdi     # 0x4a8e0
leaq 0x68e5(%rip), %rsi      # 0x16fbb
movq %rbx, %rdx
movq %r14, %rcx
movl %ebp, %r8d
movl %r15d, %r9d
xorl %eax, %eax
callq 0x3540
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_filename_to_host
char *rt11_filename_to_host(char *filnam, char *ext, char *streamname) {
	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);
	}
	if (streamname && strlen(streamname)) {
		strcat(result, ".");
		strcat(result, streamname);
	}

	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rdx, %rbx
movq %rsi, %r14
callq 0xa6d4
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x30d0
movq %r14, %rdi
callq 0xa6d4
movq %rsp, %rdi
movq %rax, %rsi
callq 0x30d0
cmpb $0x0, (%r15)
jne 0x10742
movw $0x5f, 0x50(%rsp)
leaq 0x25807(%rip), %r14     # 0x35f50
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x30d0
cmpb $0x0, (%rsp)
je 0x10776
movq %r14, %rdi
callq 0x31a0
movw $0x2e, (%rax,%r14)
movq %rsp, %rsi
movq %r14, %rdi
callq 0x3520
testq %rbx, %rbx
je 0x1079a
cmpb $0x0, (%rbx)
je 0x1079a
movq %r14, %rdi
callq 0x31a0
movw $0x2e, (%rax,%r14)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3520
leaq 0x257af(%rip), %rax     # 0x35f50
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq