LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: state_text
char *state_text(hostdir_side_t side, hostdir_file_state_t state) {
	static char buff[2][80];
	char *statetxt[] = { "unchanged", "missing", "changed", "created" };
	char *sidetxt[] = { "PDP", "host" };
	char *result = buff[side]; // static buffer for each side
	sprintf(result, "%s on %s", statetxt[state], sidetxt[side]);
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movq 0x17a1b(%rip), %rax     # 0x22cf0
movq %rax, -0x30(%rbp)
movq 0x17a18(%rip), %rax     # 0x22cf8
movq %rax, -0x28(%rbp)
movq 0x17a15(%rip), %rax     # 0x22d00
movq %rax, -0x20(%rbp)
movq 0x17a12(%rip), %rax     # 0x22d08
movq %rax, -0x18(%rbp)
movq 0x17a0f(%rip), %rax     # 0x22d10
movq %rax, -0x40(%rbp)
movq 0x17a0c(%rip), %rax     # 0x22d18
movq %rax, -0x38(%rbp)
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x1a174(%rip), %rax     # 0x25490
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movl -0x8(%rbp), %eax
movq -0x30(%rbp,%rax,8), %rdx
movl -0x4(%rbp), %eax
movq -0x40(%rbp,%rax,8), %rcx
leaq 0x10f82(%rip), %rsi     # 0x1c2c4
movb $0x0, %al
callq 0x3520
movq -0x48(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: hostdir_from_pdp_fs
int hostdir_from_pdp_fs(hostdir_t *_this) {
	char pathbuff[4096];
	int fileidx;
	struct utimbuf ut;
	// known filesystems have max 3 special files (RT11)
	for (fileidx = -FILESYSTEM_MAX_SPECIALFILE_COUNT; fileidx < *_this->pdp_fs->file_count;
			fileidx++) {
		int i;
		file_t *f = filesystem_file_get(_this->pdp_fs, fileidx);
		if (f)
			for (i = 0; i < FILESYSTEM_MAX_DATASTREAM_COUNT; i++)
				if (f->stream[i].valid) {
					file_stream_t *stream = &f->stream[i];
					sprintf(pathbuff, "%s/%s", _this->path,
							filesystem_filename_to_host(_this->pdp_fs, f->filnam, f->ext,
									stream->name));
					file_write(pathbuff, stream->data, stream->data_size);
					if (fileidx >= 0) {
						// regular file, not bootblock or monitor: set original file date
						ut.modtime = mktime(&f->date);
						ut.actime = mktime(&f->date);
						utime(pathbuff, &ut);
					}
				}
	}
	return ERROR_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1050, %rsp           # imm = 0x1050
movq %rdi, -0x8(%rbp)
movl $0xfffffff7, -0x1014(%rbp) # imm = 0xFFFFFFF7
movl -0x1014(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x1008(%rcx), %rcx
movq 0x18(%rcx), %rcx
cmpl (%rcx), %eax
jge 0xb9c4
movq -0x8(%rbp), %rax
movq 0x1008(%rax), %rdi
movl -0x1014(%rbp), %esi
callq 0xefe0
movq %rax, -0x1038(%rbp)
cmpq $0x0, -0x1038(%rbp)
je 0xb9ae
movl $0x0, -0x102c(%rbp)
cmpl $0x3, -0x102c(%rbp)
jge 0xb9ac
movq -0x1038(%rbp), %rax
addq $0x78, %rax
movslq -0x102c(%rbp), %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
je 0xb996
movq -0x1038(%rbp), %rax
addq $0x78, %rax
movslq -0x102c(%rbp), %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x1040(%rbp)
leaq -0x1010(%rbp), %rax
movq %rax, -0x1050(%rbp)
movq -0x8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x1048(%rbp)
movq -0x8(%rbp), %rax
movq 0x1008(%rax), %rdi
movq -0x1038(%rbp), %rsi
movq -0x1038(%rbp), %rdx
addq $0x50, %rdx
movq -0x1040(%rbp), %rcx
addq $0x10, %rcx
callq 0xf500
movq -0x1050(%rbp), %rdi
movq -0x1048(%rbp), %rdx
movq %rax, %rcx
leaq 0x10a59(%rip), %rsi     # 0x1c375
movb $0x0, %al
callq 0x3520
leaq -0x1010(%rbp), %rdi
movq -0x1040(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x1040(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xd4d0
cmpl $0x0, -0x1014(%rbp)
jl 0xb994
movq -0x1038(%rbp), %rdi
addq $0x1b0, %rdi            # imm = 0x1B0
callq 0x33e0
movq %rax, -0x1020(%rbp)
movq -0x1038(%rbp), %rdi
addq $0x1b0, %rdi            # imm = 0x1B0
callq 0x33e0
movq %rax, -0x1028(%rbp)
leaq -0x1010(%rbp), %rdi
leaq -0x1028(%rbp), %rsi
callq 0x3030
jmp 0xb996
jmp 0xb998
movl -0x102c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x102c(%rbp)
jmp 0xb86b
jmp 0xb9ae
jmp 0xb9b0
movl -0x1014(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1014(%rbp)
jmp 0xb819
xorl %eax, %eax
addq $0x1050, %rsp           # imm = 0x1050
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: hostdir_to_pdp_fs
int hostdir_to_pdp_fs(hostdir_t *_this) {
	char pathbuff[4096];
	char *names[10000];
	int filecount;
	// load filenames
	// delete content
	struct stat sb;
	DIR *dfd;
	struct dirent *dp;
	int i;

	dfd = opendir(_this->path); // error checking done, compact code
	filecount = 0;
	// make list of regular files
	while ((dp = readdir(dfd))) {
		sprintf(pathbuff, "%s/%s", _this->path, dp->d_name);
		// beware of . and ..
		if (stat(pathbuff, &sb))
			break;
		if (S_ISREG(sb.st_mode)) {
			names[filecount++] = strdup(dp->d_name);
		}
	}

	// sort names[] according to filesystem order
	filename_sort(names, filecount, filesystem_fileorder(_this->pdp_fs), -1);

	// add all files
	filesystem_init(_this->pdp_fs);
	for (i = 0; i < filecount; i++) {
		if (pdp_fs_file_add(_this, _this->pdp_fs, _this->path, names[i]))
			return error_set(error_code, "Unit %d: Host dir to PDP filesystem", _this->unit);
	}

	return ERROR_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x14950, %rsp          # imm = 0x14950
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
callq 0x3160
movq %rax, -0x14930(%rbp)
movl $0x0, -0x14894(%rbp)
movq -0x14930(%rbp), %rdi
callq 0x3380
movq %rax, -0x14938(%rbp)
cmpq $0x0, %rax
je 0xbaa1
leaq -0x1010(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x4, %rdx
movq -0x14938(%rbp), %rcx
addq $0x13, %rcx
leaq 0x1093a(%rip), %rsi     # 0x1c375
movb $0x0, %al
callq 0x3520
leaq -0x1010(%rbp), %rdi
leaq -0x14928(%rbp), %rsi
callq 0x3310
cmpl $0x0, %eax
je 0xba5c
jmp 0xbaa1
movl -0x14910(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
jne 0xba9c
movq -0x14938(%rbp), %rdi
addq $0x13, %rdi
callq 0x3560
movq %rax, %rcx
movl -0x14894(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x14894(%rbp)
cltq
movq %rcx, -0x14890(%rbp,%rax,8)
jmp 0xb9fd
leaq -0x14890(%rbp), %rax
movq %rax, -0x14948(%rbp)
movl -0x14894(%rbp), %eax
movl %eax, -0x14940(%rbp)
movq -0x10(%rbp), %rax
movq 0x1008(%rax), %rdi
callq 0xf5f0
movq -0x14948(%rbp), %rdi
movl -0x14940(%rbp), %esi
movq %rax, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0xe780
movq -0x10(%rbp), %rax
movq 0x1008(%rax), %rdi
callq 0xedf0
movl $0x0, -0x1493c(%rbp)
movl -0x1493c(%rbp), %eax
cmpl -0x14894(%rbp), %eax
jge 0xbb72
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x1008(%rax), %rsi
movq -0x10(%rbp), %rdx
addq $0x4, %rdx
movslq -0x1493c(%rbp), %rax
movq -0x14890(%rbp,%rax,8), %rcx
callq 0xbb90
cmpl $0x0, %eax
je 0xbb5f
leaq 0x199f4(%rip), %rax     # 0x25538
movl (%rax), %edi
movq -0x10(%rbp), %rax
movl (%rax), %edx
leaq 0x108a1(%rip), %rsi     # 0x1c3f4
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0xbb79
jmp 0xbb61
movl -0x1493c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1493c(%rbp)
jmp 0xbaff
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x14950, %rsp          # imm = 0x14950
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: pdp_fs_file_add
static int pdp_fs_file_add(hostdir_t *_this, filesystem_t *fs, char *fpath, char *fname) {
	char pathbuff[4096];
	struct stat sb;
	uint8_t *data;
	unsigned data_size, n;
	FILE *f;

	sprintf(pathbuff, "%s/%s", fpath, fname);
	if (stat(pathbuff, &sb))
		return error_set(ERROR_HOSTFILE, "Unit %d: Can get statistics for \"%s\"", _this->unit, pathbuff);

	f = fopen(pathbuff, "r");
	if (!f)
		return error_set(ERROR_HOSTFILE, "Unit %d: Can not open \"%s\"", _this->unit, pathbuff);
	// use stat size to allocate data buffer
	data_size = sb.st_size;
	data = malloc(data_size);
	n = fread(data, 1, data_size, f);
	fclose(f);

	if (n != data_size)
		return error_set(ERROR_HOSTFILE, "Unit %d: Read %d bytes instead of %d from \"%s\"", _this->unit, n,
				data_size, pathbuff);

	// add to filesystem
	filesystem_file_add(fs, fname, STAT_ST_MTIM(sb).tv_sec, sb.st_mode, data, data_size);

	free(data);
	return ERROR_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10e0, %rsp           # imm = 0x10E0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
leaq -0x1030(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq 0x107b4(%rip), %rsi     # 0x1c375
movb $0x0, %al
callq 0x3520
leaq -0x1030(%rbp), %rdi
leaq -0x10c0(%rbp), %rsi
callq 0x3310
cmpl $0x0, %eax
je 0xbc08
movq -0x10(%rbp), %rax
movl (%rax), %edx
leaq -0x1030(%rbp), %rcx
movl $0xfffffffa, %edi       # imm = 0xFFFFFFFA
leaq 0x10920(%rip), %rsi     # 0x1c519
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0xbd22
leaq -0x1030(%rbp), %rdi
leaq 0x1235c(%rip), %rsi     # 0x1df72
callq 0x34a0
movq %rax, -0x10d8(%rbp)
cmpq $0x0, -0x10d8(%rbp)
jne 0xbc54
movq -0x10(%rbp), %rax
movl (%rax), %edx
leaq -0x1030(%rbp), %rcx
movl $0xfffffffa, %edi       # imm = 0xFFFFFFFA
leaq 0x108f9(%rip), %rsi     # 0x1c53e
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0xbd22
movq -0x1090(%rbp), %rax
movl %eax, -0x10cc(%rbp)
movl -0x10cc(%rbp), %eax
movl %eax, %edi
callq 0x33a0
movq %rax, -0x10c8(%rbp)
movq -0x10c8(%rbp), %rdi
movl -0x10cc(%rbp), %eax
movl %eax, %edx
movq -0x10d8(%rbp), %rcx
movl $0x1, %esi
callq 0x3100
movl %eax, -0x10d0(%rbp)
movq -0x10d8(%rbp), %rdi
callq 0x3150
movl -0x10d0(%rbp), %eax
cmpl -0x10cc(%rbp), %eax
je 0xbce7
movq -0x10(%rbp), %rax
movl (%rax), %edx
movl -0x10d0(%rbp), %ecx
movl -0x10cc(%rbp), %r8d
leaq -0x1030(%rbp), %r9
movl $0xfffffffa, %edi       # imm = 0xFFFFFFFA
leaq 0x1087e(%rip), %rsi     # 0x1c559
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0xbd22
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x1068(%rbp), %rdx
movl -0x10a8(%rbp), %ecx
movq -0x10c8(%rbp), %r8
movl -0x10cc(%rbp), %r9d
callq 0xeed0
movq -0x10c8(%rbp), %rdi
callq 0x3040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10e0, %rsp           # imm = 0x10E0
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: hostdir_create
hostdir_t *hostdir_create(int unit, char *path, filesystem_t *pdp_fs) {
	hostdir_t *_this;
	_this = malloc(sizeof(hostdir_t));
	_this->unit = unit ;
	strcpy(_this->path, path);
	_this->pdp_fs = pdp_fs;

	_this->snapshot.hostdir = _this ;
	_this->snapshot.file_count = 0;
	return _this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x530a8, %edi          # imm = 0x530A8
callq 0x33a0
movq %rax, -0x20(%rbp)
movl -0x4(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rdi
addq $0x4, %rdi
movq -0x10(%rbp), %rsi
callq 0x30c0
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x1008(%rax)
movq -0x20(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x1010(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x1018(%rax)
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: hostdir_load
int hostdir_load(hostdir_t *_this, int allowcreate, int *created) {

	if (hostdir_prepare(_this, /*wipe*/0, allowcreate, created)) {
		error("Unit %d: hostdir_prepare() failed", _this->unit);
		return -1;
	}
	if (opt_verbose && *created)
		info("Unit %d: Host directory \"%s\" created", _this->unit, _this->path);

	return hostdir_image_reload(_this);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
xorl %esi, %esi
callq 0xb360
cmpl $0x0, %eax
je 0xbe17
movq -0x10(%rbp), %rax
movl (%rax), %esi
leaq 0x10611(%rip), %rdi     # 0x1c418
movb $0x0, %al
callq 0xce70
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xbe54
leaq 0x17f46(%rip), %rax     # 0x23d64
cmpl $0x0, (%rax)
je 0xbe48
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
je 0xbe48
movq -0x10(%rbp), %rax
movl (%rax), %esi
movq -0x10(%rbp), %rdx
addq $0x4, %rdx
leaq 0x105f9(%rip), %rdi     # 0x1c43a
movb $0x0, %al
callq 0xcf60
movq -0x10(%rbp), %rdi
callq 0xbe60
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: hostdir_image_reload
static int hostdir_image_reload(hostdir_t *_this) {
	filesystem_init(_this->pdp_fs);
	hostdir_to_pdp_fs(_this); //  dir => filesystem
	filesystem_render(_this->pdp_fs); // filesystem => image
	if (opt_debug)
		filesystem_print_dir(_this->pdp_fs, ferr);
	if (opt_debug)
		filesystem_print_diag(_this->pdp_fs, ferr);

	snapshot_init(_this);
	return ERROR_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x1008(%rax), %rdi
callq 0xedf0
movq -0x8(%rbp), %rdi
callq 0xb9d0
movq -0x8(%rbp), %rax
movq 0x1008(%rax), %rdi
callq 0xf310
leaq 0x17ed8(%rip), %rax     # 0x23d74
cmpl $0x0, (%rax)
je 0xbebb
movq -0x8(%rbp), %rax
movq 0x1008(%rax), %rdi
leaq 0x1967d(%rip), %rax     # 0x25530
movq (%rax), %rsi
callq 0xf440
leaq 0x17eb2(%rip), %rax     # 0x23d74
cmpl $0x0, (%rax)
je 0xbee1
movq -0x8(%rbp), %rax
movq 0x1008(%rax), %rdi
leaq 0x19657(%rip), %rax     # 0x25530
movq (%rax), %rsi
callq 0xf4a0
movq -0x8(%rbp), %rdi
callq 0xccb0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: hostdir_save
int hostdir_save(hostdir_t *_this) {
	if (hostdir_prepare(_this, /*wipe*/1, 0, NULL))
		return error_set(error_code, "Unit %d: Saving host dir", _this->unit);
	filesystem_init(_this->pdp_fs);
	filesystem_parse(_this->pdp_fs); // image => filesystem
	hostdir_from_pdp_fs(_this); // filesystem => dir
	if (opt_debug)
		filesystem_print_dir(_this->pdp_fs, ferr);
	if (opt_debug)
		filesystem_print_diag(_this->pdp_fs, ferr);
	return ERROR_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0xb360
cmpl $0x0, %eax
je 0xbf47
leaq 0x1960c(%rip), %rax     # 0x25538
movl (%rax), %edi
movq -0x10(%rbp), %rax
movl (%rax), %edx
leaq 0x10524(%rip), %rsi     # 0x1c45f
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0xbfc3
movq -0x10(%rbp), %rax
movq 0x1008(%rax), %rdi
callq 0xedf0
movq -0x10(%rbp), %rax
movq 0x1008(%rax), %rdi
callq 0xee60
movq -0x10(%rbp), %rdi
callq 0xb800
leaq 0x17dfd(%rip), %rax     # 0x23d74
cmpl $0x0, (%rax)
je 0xbf96
movq -0x10(%rbp), %rax
movq 0x1008(%rax), %rdi
leaq 0x195a2(%rip), %rax     # 0x25530
movq (%rax), %rsi
callq 0xf440
leaq 0x17dd7(%rip), %rax     # 0x23d74
cmpl $0x0, (%rax)
je 0xbfbc
movq -0x10(%rbp), %rax
movq 0x1008(%rax), %rdi
leaq 0x1957c(%rip), %rax     # 0x25530
movq (%rax), %rsi
callq 0xf4a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: snapshot_print
static void snapshot_print(hostdir_snapshot_t *_this, FILE *stream, int all) {
	int i;
	UNUSED(stream) ;
	for (i = 0; i < _this->file_count; i++) {
		hostdir_file_t *f;
		f = &_this->file[i];
		if (all || f->state[side_pdp] != fs_unchanged || f->state[side_host] != fs_unchanged) {
			info("Unit %d, file %3d: %10s %s, %s.", _this->hostdir->unit,
				i, f->pdp_filnam_ext_stream,
					state_text(side_pdp, f->state[side_pdp]),
					state_text(side_host, f->state[side_host]));
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0xcb46
movq -0x8(%rbp), %rax
addq $0x10, %rax
movslq -0x18(%rbp), %rcx
imulq $0x150, %rcx, %rcx      # imm = 0x150
addq %rcx, %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0xcad4
movq -0x20(%rbp), %rax
cmpl $0x0, 0x128(%rax)
jne 0xcad4
movq -0x20(%rbp), %rax
cmpl $0x0, 0x12c(%rax)
je 0xcb36
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl 0x128(%rax), %esi
xorl %edi, %edi
callq 0xb2c0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x12c(%rax), %esi
movl $0x1, %edi
callq 0xb2c0
movl -0x38(%rbp), %esi
movl -0x34(%rbp), %edx
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %r8
movq %rax, %r9
leaq 0xfaba(%rip), %rdi      # 0x1c5e9
movb $0x0, %al
callq 0xcf60
jmp 0xcb38
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xca8a
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: hostdir_file_copy_from_pdp
static void hostdir_file_copy_from_pdp(hostdir_t *_this, hostdir_file_t *f) {
	char pathbuff[4096];
	file_t *fpdp;
	file_stream_t *stream;
	sprintf(pathbuff, "%s/%s", _this->path, f->pdp_filnam_ext_stream);

	fpdp = filesystem_file_get(_this->pdp_fs, f->pdp_fileidx); // also boot and monitor
	stream = &fpdp->stream[f->pdp_streamidx];
	if (!dbg_simulate)
		file_write(pathbuff, stream->data, stream->data_size);
	if (opt_verbose)
		info("Unit %d: Copied file \"%s\" from PDP to shared dir.", _this->unit, pathbuff);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1020, %rsp           # imm = 0x1020
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x1010(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x4, %rdx
movq -0x10(%rbp), %rcx
leaq 0xf7f8(%rip), %rsi      # 0x1c375
movb $0x0, %al
callq 0x3520
movq -0x8(%rbp), %rax
movq 0x1008(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x140(%rax), %esi
callq 0xefe0
movq %rax, -0x1018(%rbp)
movq -0x1018(%rbp), %rax
addq $0x78, %rax
movq -0x10(%rbp), %rcx
movslq 0x144(%rcx), %rcx
imulq $0x68, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x1020(%rbp)
cmpl $0x0, 0x188b0(%rip)     # 0x25480
jne 0xcbf3
leaq -0x1010(%rbp), %rdi
movq -0x1020(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x1020(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xd4d0
leaq 0x1716a(%rip), %rax     # 0x23d64
cmpl $0x0, (%rax)
je 0xcc1a
movq -0x8(%rbp), %rax
movl (%rax), %esi
leaq -0x1010(%rbp), %rdx
leaq 0xf9f6(%rip), %rdi      # 0x1c609
movb $0x0, %al
callq 0xcf60
addq $0x1020, %rsp           # imm = 0x1020
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: hostdir_file_delete
static void hostdir_file_delete(hostdir_t *_this, hostdir_file_t *f) {
	char pathbuff[4096];
	sprintf(pathbuff, "%s/%s", _this->path, f->hostfilename);
	if (!dbg_simulate)
		remove(pathbuff);
	if (opt_verbose)
		info("Unit %d: Deleted file \"%s\" on shared dir.", _this->unit, pathbuff);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1010, %rsp           # imm = 0x1010
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x1010(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0x4, %rdx
movq -0x10(%rbp), %rcx
addq $0x28, %rcx
leaq 0xf714(%rip), %rsi      # 0x1c375
movb $0x0, %al
callq 0x3520
cmpl $0x0, 0x18811(%rip)     # 0x25480
jne 0xcc7d
leaq -0x1010(%rbp), %rdi
callq 0x30a0
leaq 0x170e0(%rip), %rax     # 0x23d64
cmpl $0x0, (%rax)
je 0xcca4
movq -0x8(%rbp), %rax
movl (%rax), %esi
leaq -0x1010(%rbp), %rdx
leaq 0xf99e(%rip), %rdi      # 0x1c63b
movb $0x0, %al
callq 0xcf60
addq $0x1010, %rsp           # imm = 0x1010
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: snapshot_init
static void snapshot_init(hostdir_t *_this) {
	_this->snapshot.file_count = 0;
	snapshot_scan_hostdir(_this);
	snapshot_scan_pdpimage(_this);
	snapshot_clear_states(_this);
	// now both sides "unchanged"
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x1018(%rax)
movq -0x8(%rbp), %rdi
callq 0xc5b0
movq -0x8(%rbp), %rdi
callq 0xc860
movq -0x8(%rbp), %rdi
callq 0xccf0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: snapshot_clear_states
static int snapshot_clear_states(hostdir_t *_this) {
	int i;
	for (i = 0; i < _this->snapshot.file_count; i++) {
		hostdir_file_t *f = &_this->snapshot.file[i];
		f->state[side_pdp] = f->state[side_host] = fs_unchanged;
	}
	return ERROR_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1018(%rcx), %eax
jge 0xcd55
movq -0x8(%rbp), %rax
addq $0x1010, %rax           # imm = 0x1010
addq $0x10, %rax
movslq -0xc(%rbp), %rcx
imulq $0x150, %rcx, %rcx      # imm = 0x150
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl $0x0, 0x12c(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x128(%rax)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xccff
xorl %eax, %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/error.c
// Function: error_set
int error_set(int code, char *fmt, ...) {
	char buffer[1024];
	va_list args;
//	assert(error_trace_level < ERROR_MAX_TRACE_LEVEL) ;
	error_code = code;
	if (code == ERROR_OK)
		error_clear();
	else if (fmt && strlen(fmt)) {
		va_start(args, fmt);
		vsprintf(buffer, fmt, args);
		va_end(args);
		// strcpy(error_message[error_trace_level++], buffer);
		error(buffer);
	}
	return error_code;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4e0, %rsp            # imm = 0x4E0
testb %al, %al
je 0xcdb7
movaps %xmm0, -0x4b0(%rbp)
movaps %xmm1, -0x4a0(%rbp)
movaps %xmm2, -0x490(%rbp)
movaps %xmm3, -0x480(%rbp)
movaps %xmm4, -0x470(%rbp)
movaps %xmm5, -0x460(%rbp)
movaps %xmm6, -0x450(%rbp)
movaps %xmm7, -0x440(%rbp)
movq %r9, -0x4b8(%rbp)
movq %r8, -0x4c0(%rbp)
movq %rcx, -0x4c8(%rbp)
movq %rdx, -0x4d0(%rbp)
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x4(%rbp), %eax
movl %eax, 0x18755(%rip)     # 0x25538
cmpl $0x0, -0x4(%rbp)
jne 0xcdf0
callq 0xcd60
jmp 0xce5b
cmpq $0x0, -0x10(%rbp)
je 0xce59
movq -0x10(%rbp), %rdi
callq 0x3190
cmpq $0x0, %rax
je 0xce59
leaq -0x430(%rbp), %rax
leaq -0x4e0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
leaq -0x410(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x430(%rbp), %rdx
callq 0x3460
leaq -0x430(%rbp), %rax
leaq -0x410(%rbp), %rdi
movb $0x0, %al
callq 0xce70
jmp 0xce5b
movl 0x186d7(%rip), %eax     # 0x25538
addq $0x4e0, %rsp            # imm = 0x4E0
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/error.c
// Function: error
void error(char *fmt, ...) {
	va_list args;
	va_start(args, fmt);
	fprintf(ferr, "[%s ERROR]  ", cur_time_text());
	vfprintf(ferr, fmt, args);
	fprintf(ferr, "\n");
	va_end(args);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0xcea5
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r9, -0xa8(%rbp)
movq %r8, -0xb0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
leaq -0xd0(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x30, -0x1c(%rbp)
movl $0x8, -0x20(%rbp)
movq 0x1863c(%rip), %rax     # 0x25530
movq %rax, -0xe0(%rbp)
callq 0xd380
movq -0xe0(%rbp), %rdi
movq %rax, %rdx
leaq 0xf76f(%rip), %rsi      # 0x1c680
xorl %eax, %eax
movb %al, -0xd1(%rbp)
callq 0x3300
movq 0x1860b(%rip), %rdi     # 0x25530
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x34e0
movb -0xd1(%rbp), %al
movq 0x185f1(%rip), %rdi     # 0x25530
leaq 0xf77d(%rip), %rsi      # 0x1c6c3
callq 0x3300
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/error.c
// Function: info
void info(char *fmt, ...) {
	va_list args;
	if (!opt_background) {
		va_start(args, fmt);
		fprintf(ferr, "[%s info]  ", cur_time_text());
		vfprintf(ferr, fmt, args);
		fprintf(ferr, "\n");
		va_end(args);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0xcf95
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r9, -0xa8(%rbp)
movq %r8, -0xb0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
leaq 0x16db9(%rip), %rax     # 0x23d7c
cmpl $0x0, (%rax)
jne 0xd044
leaq -0x20(%rbp), %rax
leaq -0xd0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
movq 0x1853d(%rip), %rax     # 0x25530
movq %rax, -0xd8(%rbp)
callq 0xd380
movq -0xd8(%rbp), %rdi
movq %rax, %rdx
leaq 0xf655(%rip), %rsi      # 0x1c665
movb $0x0, %al
callq 0x3300
movq 0x18512(%rip), %rdi     # 0x25530
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x34e0
movq 0x184fe(%rip), %rdi     # 0x25530
leaq 0xf68a(%rip), %rsi      # 0x1c6c3
movb $0x0, %al
callq 0x3300
leaq -0x20(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/error.c
// Function: warning
void warning(char *fmt, ...) {
	va_list args;
	if (!opt_background) {
		va_start(args, fmt);
		fprintf(ferr, "[%s Warning]  ", cur_time_text());
		vfprintf(ferr, fmt, args);
		fprintf(ferr, "\n");
		va_end(args);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0xd085
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r9, -0xa8(%rbp)
movq %r8, -0xb0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
leaq 0x16cc9(%rip), %rax     # 0x23d7c
cmpl $0x0, (%rax)
jne 0xd134
leaq -0x20(%rbp), %rax
leaq -0xd0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
movq 0x1844d(%rip), %rax     # 0x25530
movq %rax, -0xd8(%rbp)
callq 0xd380
movq -0xd8(%rbp), %rdi
movq %rax, %rdx
leaq 0xf571(%rip), %rsi      # 0x1c671
movb $0x0, %al
callq 0x3300
movq 0x18422(%rip), %rdi     # 0x25530
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x34e0
movq 0x1840e(%rip), %rdi     # 0x25530
leaq 0xf59a(%rip), %rsi      # 0x1c6c3
movb $0x0, %al
callq 0x3300
leaq -0x20(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/error.c
// Function: fatal
void fatal(char *fmt, ...) {
	va_list args;
	va_start(args, fmt);
	fprintf(ferr, "[%s FATAL]  ", cur_time_text());
	vfprintf(ferr, fmt, args);
	fprintf(ferr, "\n");
	va_end(args);
	exit(EXIT_FAILURE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0xd175
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r9, -0xa8(%rbp)
movq %r8, -0xb0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
leaq -0x20(%rbp), %rax
leaq -0xd0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
movq 0x18369(%rip), %rax     # 0x25530
movq %rax, -0xd8(%rbp)
callq 0xd380
movq -0xd8(%rbp), %rdi
movq %rax, %rdx
leaq 0xf4a9(%rip), %rsi      # 0x1c68d
movb $0x0, %al
callq 0x3300
movq 0x1833e(%rip), %rdi     # 0x25530
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x34e0
movq 0x1832a(%rip), %rdi     # 0x25530
leaq 0xf4b6(%rip), %rsi      # 0x1c6c3
movb $0x0, %al
callq 0x3300
leaq -0x20(%rbp), %rax
movl $0x1, %edi
callq 0x3530
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/utils.c
// Function: delay_us
void delay_us(int32_t us) {
	struct timespec rqtp;
	int32_t sts;

	// check if any delay required
	if (us <= 0)
		return;

	// nanosleep() preferred over usleep(),
	// compute integer seconds and fraction (in nanoseconds)
	rqtp.tv_sec = us / 1000000L;
	rqtp.tv_nsec = (us % 1000000L) * 1000L;

	// if nanosleep() fails then just plain sleep()
	if ((sts = nanosleep(&rqtp, NULL)) == -1)
		sleep(rqtp.tv_sec);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jg 0xd243
jmp 0xd28e
movslq -0x4(%rbp), %rax
movl $0xf4240, %ecx          # imm = 0xF4240
cqto
idivq %rcx
movq %rax, -0x18(%rbp)
movslq -0x4(%rbp), %rax
movl $0xf4240, %ecx          # imm = 0xF4240
cqto
idivq %rcx
imulq $0x3e8, %rdx, %rax      # imm = 0x3E8
movq %rax, -0x10(%rbp)
leaq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x31e0
movl %eax, -0x1c(%rbp)
cmpl $-0x1, %eax
jne 0xd28e
movq -0x18(%rbp), %rax
movl %eax, %edi
callq 0x3580
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/utils.c
// Function: cur_time_text
char *cur_time_text() {
	static char result[40] ;
	time_t timer;
	struct tm* tm_info;
	time(&timer);
	tm_info = localtime(&timer);
	strftime(result, 26, "%H:%M:%S", tm_info);
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq -0x8(%rbp), %rdi
callq 0x3350
leaq -0x8(%rbp), %rdi
callq 0x3060
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rcx
leaq 0x181a7(%rip), %rdi     # 0x25550
movl $0x1a, %esi
leaq 0xf2e5(%rip), %rdx      # 0x1c69a
callq 0x3440
leaq 0x1818f(%rip), %rax     # 0x25550
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movl %edx, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0xd418
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movzbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
je 0xd3ff
movl $0x0, -0x4(%rbp)
jmp 0xd41f
jmp 0xd401
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xd3e1
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x10b22(%rip), %rsi     # 0x1df72
callq 0x34a0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl -0x10(%rbp), %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x33f0
movl $0x1, -0x14(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x14(%rbp)
movb %al, -0x22(%rbp)
je 0xd49a
movq -0x20(%rbp), %rcx
leaq -0x21(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x3100
cmpq $0x1, %rax
sete %al
movb %al, -0x22(%rbp)
movb -0x22(%rbp), %al
testb $0x1, %al
jne 0xd4a3
jmp 0xd4b8
movzbl -0x21(%rbp), %eax
movzbl -0x9(%rbp), %ecx
cmpl %ecx, %eax
je 0xd4b6
movl $0x0, -0x14(%rbp)
jmp 0xd470
movq -0x20(%rbp), %rdi
callq 0x3150
movl -0x14(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
movl $0x242, %esi            # imm = 0x242
movl $0x1b6, %edx            # imm = 0x1B6
movb $0x0, %al
callq 0x3490
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jge 0xd51d
movq -0x10(%rbp), %rdx
movl $0xfffffffa, %edi       # imm = 0xFFFFFFFA
leaq 0xf192(%rip), %rsi      # 0x1c6a3
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0xd53d
movl -0x20(%rbp), %edi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %eax
movl %eax, %edx
callq 0x3140
movl -0x20(%rbp), %edi
callq 0x3260
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movq 0x15a6b(%rip), %rax     # 0x22fd8
movq (%rax), %rdx
leaq 0x18009(%rip), %rdi     # 0x25580
movl $0x400, %esi            # imm = 0x400
callq 0x32b0
cmpq $0x0, %rax
je 0xd5f6
leaq 0x17ff2(%rip), %rdi     # 0x25580
leaq 0xf12c(%rip), %rsi      # 0x1c6c1
callq 0x34c0
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x19(%rbp)
je 0xd5bb
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0xd5c4
jmp 0xd5f4
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x10(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
xorl %eax, %eax
movl %eax, %edi
leaq 0xf0d8(%rip), %rsi      # 0x1c6c1
callq 0x34c0
movq %rax, -0x18(%rbp)
jmp 0xd59e
jmp 0xd5f6
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3190
cmpq $0x400, %rax            # imm = 0x400
jae 0xd637
jmp 0xd656
leaq 0xf087(%rip), %rdi      # 0x1c6c5
leaq 0xf09b(%rip), %rsi      # 0x1c6e0
movl $0xbe, %edx
leaq 0xf097(%rip), %rcx      # 0x1c6e8
callq 0x3200
jmp 0xd658
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x11(%rbp)
je 0xd68d
callq 0x35c0
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
testb $0x1, %al
jne 0xd696
jmp 0xd6a4
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xd658
movq -0x10(%rbp), %rsi
leaq 0x182d1(%rip), %rdi     # 0x25980
callq 0x30c0
leaq 0x182c5(%rip), %rdi     # 0x25980
callq 0x3190
movq %rax, %rcx
leaq 0x182b6(%rip), %rax     # 0x25980
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
xorl %eax, %eax
leaq 0x182a2(%rip), %rcx     # 0x25980
cmpq %rcx, -0x10(%rbp)
movb %al, -0x12(%rbp)
jbe 0xd70b
callq 0x35c0
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x12(%rbp)
movb -0x12(%rbp), %al
testb $0x1, %al
jne 0xd714
jmp 0xd722
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xd6d5
movq -0x10(%rbp), %rax
movb $0x0, 0x1(%rax)
leaq 0x1824f(%rip), %rax     # 0x25980
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movb %al, -0xd(%rbp)
movsbl -0xd(%rbp), %eax
movslq -0xc(%rbp), %rdx
leaq 0x1861d(%rip), %rdi     # 0x25d80
movzbl %al, %esi
callq 0x3220
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3190
movq -0x18(%rbp), %rsi
movq %rax, %rdx
leaq 0x185f6(%rip), %rdi     # 0x25d80
callq 0x3090
movslq -0xc(%rbp), %rcx
leaq 0x185e6(%rip), %rax     # 0x25d80
movb $0x0, (%rax,%rcx)
leaq 0x185db(%rip), %rax     # 0x25d80
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movzwl -0x2(%rbp), %eax
movl $0x28, %ecx
cltd
idivl %ecx
movl %edx, %edi
callq 0xda10
movb %al, 0x18bda(%rip)      # 0x26582
movzwl -0x2(%rbp), %eax
movl $0x28, %ecx
cltd
idivl %ecx
movw %ax, -0x2(%rbp)
movzwl -0x2(%rbp), %eax
movl $0x28, %ecx
cltd
idivl %ecx
movl %edx, %edi
callq 0xda10
movb %al, 0x18bb0(%rip)      # 0x26581
movzwl -0x2(%rbp), %eax
movl $0x28, %ecx
cltd
idivl %ecx
movw %ax, -0x2(%rbp)
movzwl -0x2(%rbp), %edi
callq 0xda10
movb %al, 0x18b90(%rip)      # 0x26580
movb $0x0, 0x18b8c(%rip)     # 0x26583
leaq 0x18b82(%rip), %rax     # 0x26580
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jne 0xda26
movl $0x20, -0x4(%rbp)
jmp 0xda8e
cmpl $0x1, -0x8(%rbp)
jl 0xda40
cmpl $0x1a, -0x8(%rbp)
jg 0xda40
movl -0x8(%rbp), %eax
addl $0x41, %eax
subl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xda8e
cmpl $0x1b, -0x8(%rbp)
jne 0xda4f
movl $0x24, -0x4(%rbp)
jmp 0xda8e
cmpl $0x1c, -0x8(%rbp)
jne 0xda5e
movl $0x2e, -0x4(%rbp)
jmp 0xda8e
cmpl $0x1d, -0x8(%rbp)
jne 0xda6d
movl $0x25, -0x4(%rbp)
jmp 0xda8e
cmpl $0x1e, -0x8(%rbp)
jl 0xda87
cmpl $0x27, -0x8(%rbp)
jg 0xda87
movl -0x8(%rbp), %eax
addl $0x30, %eax
subl $0x1e, %eax
movl %eax, -0x4(%rbp)
jmp 0xda8e
movl $0x25, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movw $0x0, -0x12(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xdac4
movw $0x0, -0x2(%rbp)
jmp 0xdb5f
movq -0x10(%rbp), %rdi
callq 0x3190
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jle 0xdaf5
movq -0x10(%rbp), %rax
movsbl (%rax), %edi
callq 0x30e0
movl %eax, %edi
callq 0xdb70
movl %eax, %ecx
movzwl -0x12(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x12(%rbp)
movzwl -0x12(%rbp), %eax
imull $0x28, %eax, %eax
movw %ax, -0x12(%rbp)
cmpl $0x1, -0x18(%rbp)
jle 0xdb26
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %edi
callq 0x30e0
movl %eax, %edi
callq 0xdb70
movl %eax, %ecx
movzwl -0x12(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x12(%rbp)
movzwl -0x12(%rbp), %eax
imull $0x28, %eax, %eax
movw %ax, -0x12(%rbp)
cmpl $0x2, -0x18(%rbp)
jle 0xdb57
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %edi
callq 0x30e0
movl %eax, %edi
callq 0xdb70
movl %eax, %ecx
movzwl -0x12(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x12(%rbp)
movw -0x12(%rbp), %ax
movw %ax, -0x2(%rbp)
movw -0x2(%rbp), %ax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
cmpl $0x20, -0x8(%rbp)
jne 0xdb86
movl $0x0, -0x4(%rbp)
jmp 0xdbee
cmpl $0x41, -0x8(%rbp)
jl 0xdba0
cmpl $0x5a, -0x8(%rbp)
jg 0xdba0
movl -0x8(%rbp), %eax
addl $0x1, %eax
subl $0x41, %eax
movl %eax, -0x4(%rbp)
jmp 0xdbee
cmpl $0x24, -0x8(%rbp)
jne 0xdbaf
movl $0x1b, -0x4(%rbp)
jmp 0xdbee
cmpl $0x2e, -0x8(%rbp)
jne 0xdbbe
movl $0x1c, -0x4(%rbp)
jmp 0xdbee
cmpl $0x25, -0x8(%rbp)
jne 0xdbcd
movl $0x1d, -0x4(%rbp)
jmp 0xdbee
cmpl $0x30, -0x8(%rbp)
jl 0xdbe7
cmpl $0x39, -0x8(%rbp)
jg 0xdbe7
movl -0x8(%rbp), %eax
addl $0x1e, %eax
subl $0x30, %eax
movl %eax, -0x4(%rbp)
jmp 0xdbee
movl $0x1d, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10a0, %rsp           # imm = 0x10A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xdc48
movq -0x8(%rbp), %rdi
callq 0x3190
cmpq $0x0, %rax
je 0xdc48
leaq -0x1010(%rbp), %rdi
movq -0x8(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq 0xe736(%rip), %rsi      # 0x1c375
movb $0x0, %al
callq 0x3520
jmp 0xdc58
leaq -0x1010(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x30c0
leaq -0x1010(%rbp), %rdi
leaq -0x10a0(%rbp), %rsi
callq 0x3310
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
addq $0x10a0, %rsp           # imm = 0x10A0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
je 0xdcd8
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0xdcc8
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xdcca
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xdcab
cmpq $0x0, -0x20(%rbp)
je 0xdcfa
cmpl $0x0, -0x14(%rbp)
je 0xdcec
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0xdd02
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x30(%rbp)
movw %si, %ax
movq %rdi, %rcx
movq %rcx, -0x28(%rbp)
movw %ax, -0x2(%rbp)
movzwl -0x2(%rbp), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
addl $0x7b2, %eax            # imm = 0x7B2
movl %eax, -0x14(%rbp)
movzwl -0x2(%rbp), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
movl %edx, -0x1c(%rbp)
xorl %esi, %esi
movl $0x38, %edx
callq 0x3220
movl -0x14(%rbp), %edi
callq 0xdd10
movl %eax, %edx
leaq 0x15926(%rip), %rax     # 0x236e0
leaq 0x1594f(%rip), %rcx     # 0x23710
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
movslq -0x18(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0xde01
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movl -0x1c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xddd3
movq -0x30(%rbp), %rcx
movl -0x14(%rbp), %eax
subl $0x76c, %eax            # imm = 0x76C
movl %eax, 0x14(%rcx)
movl -0x18(%rbp), %eax
movl %eax, 0x10(%rcx)
movl -0x1c(%rbp), %eax
movl %eax, 0xc(%rcx)
movzwl -0x2(%rbp), %eax
movl %eax, -0x34(%rbp)
movq 0x30(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x30(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0xde90
movw %ax, %cx
movl -0x34(%rbp), %eax
movzwl %cx, %ecx
cmpl %ecx, %eax
jne 0xde58
jmp 0xde77
leaq 0xe904(%rip), %rdi      # 0x1c763
leaq 0xe87a(%rip), %rsi      # 0x1c6e0
movl $0x181, %edx            # imm = 0x181
leaq 0xe90f(%rip), %rcx      # 0x1c781
callq 0x3200
movq -0x28(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movw $0x0, -0xa(%rbp)
movl 0x14(%rax), %eax
addl $0x76c, %eax            # imm = 0x76C
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %edi
callq 0xdd10
movl %eax, %edx
leaq 0x1581e(%rip), %rax     # 0x236e0
leaq 0x15847(%rip), %rcx     # 0x23710
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x8(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x10(%rbp)
movq -0x20(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x10(%rcx), %eax
jge 0xdf0a
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xdee2
movq -0x20(%rbp), %rcx
movl -0x10(%rbp), %eax
addl 0xc(%rcx), %eax
movw %ax, -0xa(%rbp)
movl -0x14(%rbp), %eax
subl $0x7b2, %eax            # imm = 0x7B2
imull $0x3e8, %eax, %ecx      # imm = 0x3E8
movzwl -0xa(%rbp), %eax
addl %ecx, %eax
movw %ax, -0xa(%rbp)
movw -0xa(%rbp), %ax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)