LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: tuseek
static void tuseek(tu_cmdpkt *pk) {
	image_t *img;
	// check unit number for validity
	img = tu58image_get(pk->unit);
	if (!img || !img->open) {
		error("tuseek bad unit %d", pk->unit);
		endpacket(pk->unit, TUE_BADU, 0, 0);
		return;
	}

	// offline = no cartridges
	if (tu58_offline) {
		endpacket(pk->unit, TUE_BADF, 0, 0);
		return;
	}

	// seek to desired block
	if (image_blockseek(img, blocksize(pk->modifier), pk->block, 0)) {
		error("tuseek unit %d bad block 0x%04X", pk->unit, pk->block);
		endpacket(pk->unit, TUE_BADB, 0, 0);
		return;
	}

	// fake a seek time
	delay_ms(tudelay[opt_timing].seek);

	// success if we get here
	endpacket(pk->unit, TUE_SUCC, 0, 0);

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %edi
callq 0x7aa0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x9191
movq -0x10(%rbp), %rax
cmpb $0x0, 0xf4(%rax)
jne 0x91c2
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %esi
leaq 0x12ad1(%rip), %rdi     # 0x1bc71
movb $0x0, %al
callq 0xce70
movq -0x8(%rbp), %rax
movl $0xf8, %esi
xorl %ecx, %ecx
movzbl 0x4(%rax), %edi
movl %ecx, %edx
callq 0x8850
jmp 0x9281
movl 0x1bffc(%rip), %eax     # 0x251c4
cmpl $0x0, %eax
je 0x91e8
movq -0x8(%rbp), %rax
movl $0xf7, %esi
xorl %ecx, %ecx
movzbl 0x4(%rax), %edi
movl %ecx, %edx
callq 0x8850
jmp 0x9281
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %edi
callq 0x9510
movq -0x18(%rbp), %rdi
movl %eax, %esi
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %edx
xorl %ecx, %ecx
callq 0x9f00
cmpl $0x0, %eax
je 0x924d
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %esi
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %edx
leaq 0x12a56(%rip), %rdi     # 0x1bc84
movb $0x0, %al
callq 0xce70
movq -0x8(%rbp), %rax
movl $0xc9, %esi
xorl %ecx, %ecx
movzbl 0x4(%rax), %edi
movl %ecx, %edx
callq 0x8850
jmp 0x9281
leaq 0x1ab14(%rip), %rax     # 0x23d68
movslq (%rax), %rcx
leaq 0x1a372(%rip), %rax     # 0x235d0
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movzwl 0x6(%rax), %edi
callq 0xd2a0
movq -0x8(%rbp), %rax
xorl %ecx, %ecx
movzbl 0x4(%rax), %edi
movl %ecx, %esi
movl %ecx, %edx
callq 0x8850
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: putpacket
static void putpacket(tu_packet *pkt) {
	int32_t count = pkt->cmd.length + 2; // +2 for flag/length bytes
	uint8_t *ptr = (uint8_t *) pkt; // start at flag byte
	uint16_t chksum;

	// send all packet bytes
	while (--count >= 0) {
		serial_devtxput(&tu58_serial, *ptr++);
		wait4cont(mrsp);
	}

	// compute/send checksum bytes, append to packet
	chksum = checksum(pkt);
	serial_devtxput(&tu58_serial, *ptr++ = chksum >> 0);
	wait4cont(mrsp);
	serial_devtxput(&tu58_serial, *ptr++ = chksum >> 8);
	wait4cont(mrsp);

	// for debug...
	if (opt_debug)
		dumppacket(pkt, "putpacket");

	// now actually send the packet (or whatever is left to send)
	serial_devtxflush(&tu58_serial);

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
addl $0x2, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, %eax
jl 0x92ec
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
leaq 0x1bef2(%rip), %rdi     # 0x251c8
movzbl (%rax), %esi
callq 0xa9b0
movzbl 0x1be8b(%rip), %edi     # 0x25170
callq 0x9540
jmp 0x92b2
movq -0x8(%rbp), %rdi
callq 0x9390
movw %ax, -0x1a(%rbp)
movzwl -0x1a(%rbp), %eax
sarl $0x0, %eax
movq -0x18(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %al, (%rcx)
leaq 0x1beb0(%rip), %rdi     # 0x251c8
movzbl %al, %esi
callq 0xa9b0
movzbl 0x1be49(%rip), %edi     # 0x25170
callq 0x9540
movzwl -0x1a(%rbp), %eax
sarl $0x8, %eax
movq -0x18(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %al, (%rcx)
leaq 0x1be7d(%rip), %rdi     # 0x251c8
movzbl %al, %esi
callq 0xa9b0
movzbl 0x1be16(%rip), %edi     # 0x25170
callq 0x9540
leaq 0x1aa0e(%rip), %rax     # 0x23d74
cmpl $0x0, (%rax)
je 0x937b
movq -0x8(%rbp), %rdi
leaq 0x1292e(%rip), %rsi     # 0x1bca4
callq 0x9420
leaq 0x1be46(%rip), %rdi     # 0x251c8
callq 0xa8a0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: checksum
static uint16_t checksum(tu_packet *pkt) {
	int32_t count = pkt->cmd.length + 2; // +2 for flag/length bytes
	uint8_t *ptr = (uint8_t *) pkt; // start at flag byte
	uint32_t chksum = 0; // initial checksum value

	while (--count >= 0) {
		chksum += *ptr++; // at least one byte
		if (--count >= 0)
			chksum += (*ptr++ << 8); // at least two bytes
		chksum = (chksum + (chksum >> 16)) & 0xFFFF; // 16b end around carry
	}

	return chksum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
addl $0x2, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, %eax
jl 0x9419
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movzbl (%rax), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, %eax
jl 0x9404
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movzbl (%rax), %eax
shll $0x8, %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl -0x1c(%rbp), %ecx
shrl $0x10, %ecx
addl %ecx, %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl %eax, -0x1c(%rbp)
jmp 0x93b5
movl -0x1c(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: dumppacket
static void dumppacket(tu_packet *pkt, char *name) {
	int32_t count = 0;
	uint8_t *ptr = (uint8_t *) pkt;

	// formatted packet dump, but skip it in background mode
	if (!opt_background) {
		fprintf(ferr, "info: %s()\n", name);
		while (count++ < pkt->cmd.length + 2) {
			if (count == 3 || ((count - 4) % 32 == 31))
				fprintf(ferr, "\n");
			fprintf(ferr, " %02X", *ptr++);
		}
		fprintf(ferr, "\n %02X %02X\n", ptr[0], ptr[1]);
	}

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x1a936(%rip), %rax     # 0x23d7c
cmpl $0x0, (%rax)
jne 0x9509
leaq 0x1c0da(%rip), %rax     # 0x25530
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x1260e(%rip), %rsi     # 0x1ba72
movb $0x0, %al
callq 0x3300
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
addl $0x2, %ecx
cmpl %ecx, %eax
jge 0x94e2
cmpl $0x3, -0x14(%rbp)
je 0x949e
movl -0x14(%rbp), %eax
subl $0x4, %eax
movl $0x20, %ecx
cltd
idivl %ecx
cmpl $0x1f, %edx
jne 0x94b6
leaq 0x1c08b(%rip), %rax     # 0x25530
movq (%rax), %rdi
leaq 0x13214(%rip), %rsi     # 0x1c6c3
movb $0x0, %al
callq 0x3300
leaq 0x1c073(%rip), %rax     # 0x25530
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movzbl (%rax), %edx
leaq 0x125a5(%rip), %rsi     # 0x1ba7e
movb $0x0, %al
callq 0x3300
jmp 0x946b
leaq 0x1c047(%rip), %rax     # 0x25530
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movzbl (%rax), %edx
movq -0x20(%rbp), %rax
movzbl 0x1(%rax), %ecx
leaq 0x12582(%rip), %rsi     # 0x1ba84
movb $0x0, %al
callq 0x3300
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/tu58drive.c
// Function: wait4cont
static void wait4cont(uint8_t code) {
	uint8_t c;
	int32_t maxchar = TU_CTRL_LEN + TU_DATA_LEN + 8;

	// send any existing data out ... makes USB serial emulation be real slow if enabled!
	if (0)
		serial_devtxflush(&tu58_serial);

	// don't do any waiting if flag not set
	if (!code)
		return;

	// wait for a CONT to arrive, but only so long
	do {
		c = serial_devrxget(&tu58_serial);
		if (opt_debug)
			info("wait4cont(): char=0x%02X", c);
	} while (c != TUF_CONT && --maxchar >= 0);

	// all done
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %dil, %al
movb %al, -0x1(%rbp)
movl $0x92, -0x8(%rbp)
cmpb $0x0, -0x1(%rbp)
jne 0x955d
jmp 0x95b7
jmp 0x955f
leaq 0x1bc62(%rip), %rdi     # 0x251c8
callq 0xa940
movb %al, -0x2(%rbp)
leaq 0x1a7ff(%rip), %rax     # 0x23d74
cmpl $0x0, (%rax)
je 0x958c
movzbl -0x2(%rbp), %esi
leaq 0x12729(%rip), %rdi     # 0x1bcae
movb $0x0, %al
callq 0xcf60
jmp 0x958e
movzbl -0x2(%rbp), %ecx
xorl %eax, %eax
cmpl $0x10, %ecx
movb %al, -0x9(%rbp)
je 0x95ae
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, %eax
setge %al
movb %al, -0x9(%rbp)
movb -0x9(%rbp), %al
testb $0x1, %al
jne 0x955f
jmp 0x95b7
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/image.c
// Function: image_open
int image_open(image_t *_this, int shared, int readonly, int allowcreate, char *fname,
		filesystem_type_t dec_filesystem) {
	int filecreated;
	// save some data
	_this->host_fpath = strdup(fname); // free'd on close
	_this->shared = shared;
	_this->readonly = readonly;
	_this->dec_filesystem = dec_filesystem;
	if (shared) {
		// make filesystem from files and allocate data
		_this->pdp_filesystem = filesystem_create(dec_filesystem, _this->dec_device,
				_this->readonly, _this->data, _this->data_size, _this->changedblocks);

		_this->hostdir = hostdir_create(_this->unit, _this->host_fpath, _this->pdp_filesystem);

		if (hostdir_load(_this->hostdir, allowcreate, &filecreated))
			return error_set(error_code, "Opening shared directory");
		// data and data_size may have been enlarged !
	} else {
		// also initializes new tape
		if (image_hostfile_open(_this, allowcreate, &filecreated))
			return error_set(error_code, "Opening image file");
	}
	_this->seekpos = 0;
	_this->open = 1;

	return ERROR_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x3560
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x38(%rax)
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x3c(%rax)
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10c(%rax)
cmpl $0x0, -0x14(%rbp)
je 0x98da
movl -0x2c(%rbp), %edi
movq -0x10(%rbp), %rax
movl 0x108(%rax), %esi
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x118(%rax), %rcx
movq -0x10(%rbp), %rax
movl 0x110(%rax), %r8d
movq -0x10(%rbp), %rax
movq 0xf8(%rax), %r9
callq 0xec80
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xe0(%rax)
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0xe0(%rax), %rdx
callq 0xbd30
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0xd8(%rax)
movq -0x10(%rbp), %rax
movq 0xd8(%rax), %rdi
movl -0x1c(%rbp), %esi
leaq -0x30(%rbp), %rdx
callq 0xbdd0
cmpl $0x0, %eax
je 0x98d8
leaq 0x1bc75(%rip), %rax     # 0x25538
movl (%rax), %edi
leaq 0x1250e(%rip), %rsi     # 0x1bdda
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0x992d
jmp 0x990d
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq -0x30(%rbp), %rdx
callq 0x9940
cmpl $0x0, %eax
je 0x990b
leaq 0x1bc42(%rip), %rax     # 0x25538
movl (%rax), %edi
leaq 0x124f4(%rip), %rsi     # 0x1bdf3
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0x992d
jmp 0x990d
movq -0x10(%rbp), %rax
movl $0x0, 0x120(%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0xf4(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/image.c
// Function: image_info
void image_info(image_t *_this) {
	// output some info...
	if (_this->shared)
		info("Unit %d %10s fmt=%s size=%dKB=%d blocks, shared dir=\"%s\"", _this->unit,
				_this->readonly ? "readonly" : "read/write",
				filesystemtext[_this->dec_filesystem], _this->data_size / 1024,
				NEEDED_BLOCKS(_this->blocksize, _this->data_size), _this->host_fpath);
	else
		info("Unit %d %10s fmt=%s size=%dKB=%d blocks, img file=\"%s\"", _this->unit,
				_this->readonly ? "readonly" : "read/write",
				filesystemtext[_this->dec_filesystem], _this->data_size / 1024,
				NEEDED_BLOCKS(_this->blocksize, _this->data_size), _this->host_fpath);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0x9d8f
movq -0x8(%rbp), %rax
movl (%rax), %esi
movq -0x8(%rbp), %rax
movl 0x3c(%rax), %edx
leaq 0x1213a(%rip), %rax     # 0x1be48
leaq 0x1212a(%rip), %rcx     # 0x1be3f
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x10c(%rax), %eax
movl %eax, %ecx
leaq 0x198dd(%rip), %rax     # 0x23610
movq (%rax,%rcx,8), %rcx
movq -0x8(%rbp), %rax
movl 0x110(%rax), %r8d
shrl $0xa, %r8d
movq -0x8(%rbp), %rax
movl 0x110(%rax), %eax
movq -0x8(%rbp), %rdx
addl 0xf0(%rdx), %eax
subl $0x1, %eax
movq -0x8(%rbp), %rdi
xorl %edx, %edx
divl 0xf0(%rdi)
movq -0x10(%rbp), %rdx
movl %eax, %r9d
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
leaq 0x12087(%rip), %rdi     # 0x1be06
movq %rax, (%rsp)
movb $0x0, %al
callq 0xcf60
jmp 0x9e1f
movq -0x8(%rbp), %rax
movl (%rax), %esi
movq -0x8(%rbp), %rax
movl 0x3c(%rax), %edx
leaq 0x120a5(%rip), %rax     # 0x1be48
leaq 0x12095(%rip), %rcx     # 0x1be3f
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x10c(%rax), %eax
movl %eax, %ecx
leaq 0x19848(%rip), %rax     # 0x23610
movq (%rax,%rcx,8), %rcx
movq -0x8(%rbp), %rax
movl 0x110(%rax), %r8d
shrl $0xa, %r8d
movq -0x8(%rbp), %rax
movl 0x110(%rax), %eax
movq -0x8(%rbp), %rdx
addl 0xf0(%rdx), %eax
subl $0x1, %eax
movq -0x8(%rbp), %rdi
xorl %edx, %edx
divl 0xf0(%rdi)
movq -0x18(%rbp), %rdx
movl %eax, %r9d
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
leaq 0x1203f(%rip), %rdi     # 0x1be53
movq %rax, (%rsp)
movb $0x0, %al
callq 0xcf60
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/image.c
// Function: image_lseek
int image_lseek(image_t *_this, int offset, int whence) {
	int newpos = _this->seekpos;
	if (!_this->open)
		return error_set(ERROR_IMAGE_MODE, "image_lseek(): closed unit %d", _this->unit);
	switch (whence) {
	case SEEK_SET:
		newpos = offset;
		break;
	case SEEK_CUR:
		newpos = _this->seekpos + offset;
		break;
	case SEEK_END:
		newpos = _this->data_size + offset;
		break;
	default:
		return error_set(ERROR_ILLPARAMVAL, "image_lseek(): invalid option");
	}
	_this->seekpos = newpos;
	return newpos;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x120(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0xf4(%rax)
jne 0x9e7a
movq -0x10(%rbp), %rax
movl (%rax), %edx
movl $0xfffffff8, %edi       # imm = 0xFFFFFFF8
leaq 0x1201c(%rip), %rsi     # 0x1be8a
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0x9ef1
movl -0x18(%rbp), %eax
movl %eax, -0x20(%rbp)
testl %eax, %eax
je 0x9e9a
jmp 0x9e86
movl -0x20(%rbp), %eax
subl $0x1, %eax
je 0x9ea2
jmp 0x9e90
movl -0x20(%rbp), %eax
subl $0x2, %eax
je 0x9eb4
jmp 0x9ec6
movl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x9ede
movq -0x10(%rbp), %rax
movl 0x120(%rax), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x9ede
movq -0x10(%rbp), %rax
movl 0x110(%rax), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x9ede
movl $0xfffffff9, %edi       # imm = 0xFFFFFFF9
leaq 0x11fd6(%rip), %rsi     # 0x1bea8
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0x9ef1
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x120(%rax)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/image.c
// Function: image_blockseek
int image_blockseek(image_t *_this, int32_t blocksize, int32_t blocknr, int32_t offset) {
	int result = 0;
	if (!_this->open)
		return error_set(ERROR_IMAGE_MODE, "image_blockseek(): closed unit %d", _this->unit);

	image_lock(_this);
	// change pos to end to testsize ?
	if (blocknr * blocksize + offset > image_lseek(_this, 0, SEEK_END))
		result = ERROR_IMAGE_EOF;
	else if (image_lseek(_this, blocknr * blocksize + offset, SEEK_SET) < 0)
		result = ERROR_IMAGE_EOF;
	else
		result = ERROR_OK;
	image_unlock(_this);

	return error_set(result, "Seek error within tape block");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0xf4(%rax)
jne 0x9f4a
movq -0x10(%rbp), %rax
movl (%rax), %edx
movl $0xfffffff8, %edi       # imm = 0xFFFFFFF8
leaq 0x11f8b(%rip), %rsi     # 0x1bec6
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0x9fcb
movq -0x10(%rbp), %rdi
callq 0x9fe0
movl -0x18(%rbp), %eax
imull -0x14(%rbp), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x9e30
movl %eax, %ecx
movl -0x24(%rbp), %eax
cmpl %ecx, %eax
jle 0x9f82
movl $0xfffffff7, -0x20(%rbp) # imm = 0xFFFFFFF7
jmp 0x9fae
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
imull -0x14(%rbp), %esi
addl -0x1c(%rbp), %esi
xorl %edx, %edx
callq 0x9e30
cmpl $0x0, %eax
jge 0x9fa5
movl $0xfffffff7, -0x20(%rbp) # imm = 0xFFFFFFF7
jmp 0x9fac
movl $0x0, -0x20(%rbp)
jmp 0x9fae
movq -0x10(%rbp), %rdi
callq 0xa000
movl -0x20(%rbp), %edi
leaq 0x11f27(%rip), %rsi     # 0x1bee8
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/image.c
// Function: image_read
int image_read(image_t *_this, void *buf, int32_t count) {
	int bytesleft;
	uint8_t *src;
	if (!_this->open)
		return error_set(ERROR_IMAGE_MODE, "image_read(): closed unit %d", _this->unit);
	image_lock(_this);

	// read until count or end, set seekpos
	bytesleft = _this->data_size - _this->seekpos;
	if (count > bytesleft) {
		count = bytesleft;
	}
	src = _this->data + _this->seekpos;
	memcpy(buf, src, count);
	_this->seekpos += count;

	image_unlock(_this);
	return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0xf4(%rax)
jne 0xa05e
movq -0x10(%rbp), %rax
movl (%rax), %edx
movl $0xfffffff8, %edi       # imm = 0xFFFFFFF8
leaq 0x11eb3(%rip), %rsi     # 0x1bf05
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0xa0db
movq -0x10(%rbp), %rdi
callq 0x9fe0
movq -0x10(%rbp), %rax
movl 0x110(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0x120(%rcx), %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jle 0xa08c
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x118(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x120(%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
callq 0x3330
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x120(%rax), %ecx
movl %ecx, 0x120(%rax)
movq -0x10(%rbp), %rdi
callq 0xa000
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/image.c
// Function: image_write
int image_write(image_t *_this, void *buf, int32_t count) {
	int bytesleft;
	uint8_t *dest;
	uint32_t blknr;
	if (!_this->open)
		return error_set(ERROR_IMAGE_MODE, "image_write(): closed unit %d", _this->unit);

	if (_this->readonly)
		return error_set(ERROR_IMAGE_MODE, "unit %d read only", _this->unit);

	image_lock(_this);

	bytesleft = _this->data_size - _this->seekpos;
	if (count > bytesleft)
		count = bytesleft;

	dest = _this->data + _this->seekpos;
	memcpy(dest, buf, count);

	// set dirty
	_this->changed = 1;
	_this->changetime_ms = now_ms();
	// mark all block in range
	for (blknr = _this->seekpos / _this->blocksize;
			blknr < (_this->seekpos + count) / _this->blocksize; blknr++)
		boolarray_bit_set(_this->changedblocks, blknr);
	// boolarray_print_diag(_this->changedblocks, stderr, _this->block_count, "IMAGE");
	_this->seekpos += count;

	image_unlock(_this);
	return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0xf4(%rax)
jne 0xa131
movq -0x10(%rbp), %rax
movl (%rax), %edx
movl $0xfffffff8, %edi       # imm = 0xFFFFFFF8
leaq 0x11e00(%rip), %rsi     # 0x1bf22
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0xa258
movq -0x10(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
je 0xa15c
movq -0x10(%rbp), %rax
movl (%rax), %edx
movl $0xfffffff8, %edi       # imm = 0xFFFFFFF8
leaq 0x11e1e(%rip), %rsi     # 0x1bf6b
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0xa258
movq -0x10(%rbp), %rdi
callq 0x9fe0
movq -0x10(%rbp), %rax
movl 0x110(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0x120(%rcx), %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jle 0xa18a
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x118(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x120(%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
callq 0x3330
movq -0x10(%rbp), %rax
movb $0x1, 0xf5(%rax)
movb $0x0, %al
callq 0xd2c0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x100(%rax)
movq -0x10(%rbp), %rax
movl 0x120(%rax), %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divl 0xf0(%rcx)
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x120(%rax), %eax
addl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
xorl %edx, %edx
divl 0xf0(%rcx)
movl %eax, %ecx
movl -0x30(%rbp), %eax
cmpl %ecx, %eax
jae 0xa236
movq -0x10(%rbp), %rax
movq 0xf8(%rax), %rdi
movl -0x2c(%rbp), %esi
callq 0xe450
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xa1f0
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x120(%rax), %ecx
movl %ecx, 0x120(%rax)
movq -0x10(%rbp), %rdi
callq 0xa000
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/image.c
// Function: image_save
int image_save(image_t *_this) {
	if (!_this->open)
		return error_set(ERROR_IMAGE_MODE, "image_save(): closed unit %d", _this->unit);

	if (_this->readonly)
		return error_set(ERROR_IMAGE_MODE, "image_save(): unit %d read only", _this->unit);
	if (opt_verbose)
		info("unit %d: saving %s image to %s\"%s\"'", _this->unit,
				_this->changed ? "changed" : "unchanged", _this->shared ? "shared " : "",
				_this->host_fpath);

	image_lock(_this);
	if (_this->shared) {
		if (hostdir_save(_this->hostdir))
			error_set(error_code, "hostdir_save failed");
	} else {
		if (image_hostfile_save(_this))
			error_set(error_code, "image_hostfile_save failed");
	}
	if (!error_code) {
		_this->changed = 0;
		boolarray_clear(_this->changedblocks);
	}
	image_unlock(_this);
	return error_code;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0xf4(%rax)
jne 0xa2aa
movq -0x10(%rbp), %rax
movl (%rax), %edx
movl $0xfffffff8, %edi       # imm = 0xFFFFFFF8
leaq 0x11ca5(%rip), %rsi     # 0x1bf40
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0xa3dd
movq -0x10(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
je 0xa2d5
movq -0x10(%rbp), %rax
movl (%rax), %edx
movl $0xfffffff8, %edi       # imm = 0xFFFFFFF8
leaq 0x11c97(%rip), %rsi     # 0x1bf5d
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0xa3dd
leaq 0x19a88(%rip), %rax     # 0x23d64
cmpl $0x0, (%rax)
je 0xa339
movq -0x10(%rbp), %rax
movl (%rax), %esi
movq -0x10(%rbp), %rax
movsbl 0xf5(%rax), %ecx
leaq 0x11ca8(%rip), %rdx     # 0x1bfa1
leaq 0x11ca3(%rip), %rax     # 0x1bfa3
cmpl $0x0, %ecx
cmovneq %rax, %rdx
movq -0x10(%rbp), %rax
movl 0x38(%rax), %edi
leaq 0x123af(%rip), %rcx     # 0x1c6c4
leaq 0x11c8f(%rip), %rax     # 0x1bfab
cmpl $0x0, %edi
cmovneq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x30(%rax), %r8
leaq 0x11c4b(%rip), %rdi     # 0x1bf7d
movb $0x0, %al
callq 0xcf60
movq -0x10(%rbp), %rdi
callq 0x9fe0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0xa37a
movq -0x10(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0xbf00
cmpl $0x0, %eax
je 0xa378
leaq 0x1b1d0(%rip), %rax     # 0x25538
movl (%rax), %edi
leaq 0x11c42(%rip), %rsi     # 0x1bfb3
movb $0x0, %al
callq 0xcd70
jmp 0xa3a1
movq -0x10(%rbp), %rdi
callq 0xa3f0
cmpl $0x0, %eax
je 0xa39f
leaq 0x1b1a9(%rip), %rax     # 0x25538
movl (%rax), %edi
leaq 0x11c2f(%rip), %rsi     # 0x1bfc7
movb $0x0, %al
callq 0xcd70
jmp 0xa3a1
leaq 0x1b190(%rip), %rax     # 0x25538
cmpl $0x0, (%rax)
jne 0xa3c8
movq -0x10(%rbp), %rax
movb $0x0, 0xf5(%rax)
movq -0x10(%rbp), %rax
movq 0xf8(%rax), %rdi
callq 0xe3e0
movq -0x10(%rbp), %rdi
callq 0xa000
leaq 0x1b160(%rip), %rax     # 0x25538
movl (%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/image.c
// Function: image_hostfile_save
static int image_hostfile_save(image_t *_this) {
	int32_t fd;		// file descriptor
	fd = open(_this->host_fpath, O_BINARY | O_RDWR, 0666);
	if (fd < 0)
		return error_set(ERROR_HOSTFILE, "Unit %d: image_save cannot open \"%s\"", _this->unit,
				_this->host_fpath);

	/* undo local changes, save, restore local changes */
	if (_this->dec_filesystem != fsNONE) {
		filesystem_t *pdp_fs = filesystem_create(_this->dec_filesystem, _this->dec_device,
				_this->readonly, _this->data, _this->data_size, NULL);
		filesystem_parse(pdp_fs);
		filesystem_unpatch(pdp_fs); // RT-11: restore DD.SYS

		write(fd, _this->data, _this->data_size);

		filesystem_patch(pdp_fs); // RT-11: change DD.SYS
		filesystem_destroy(pdp_fs);
	} else
		write(fd, _this->data, _this->data_size);
	close(fd);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
movl $0x2, %esi
movl $0x1b6, %edx            # imm = 0x1B6
movb $0x0, %al
callq 0x3490
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0xa447
movq -0x10(%rbp), %rax
movl (%rax), %edx
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
movl $0xfffffffa, %edi       # imm = 0xFFFFFFFA
leaq 0x11cf1(%rip), %rsi     # 0x1c129
movb $0x0, %al
callq 0xcd70
movl %eax, -0x4(%rbp)
jmp 0xa50a
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10c(%rax)
je 0xa4dc
movq -0x10(%rbp), %rax
movl 0x10c(%rax), %edi
movq -0x10(%rbp), %rax
movl 0x108(%rax), %esi
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %edx
movq -0x10(%rbp), %rax
movq 0x118(%rax), %rcx
movq -0x10(%rbp), %rax
movl 0x110(%rax), %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0xec80
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xee60
movq -0x20(%rbp), %rdi
callq 0xf3e0
movl -0x14(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x118(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x110(%rax), %eax
movl %eax, %edx
callq 0x3140
movq -0x20(%rbp), %rdi
callq 0xf380
movq -0x20(%rbp), %rdi
callq 0xed80
jmp 0xa4fb
movl -0x14(%rbp), %edi
movq -0x10(%rbp), %rax
movq 0x118(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x110(%rax), %eax
movl %eax, %edx
callq 0x3140
movl -0x14(%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/image.c
// Function: image_sync
int image_sync(image_t *_this) {
	int result = ERROR_OK;
	if (_this->open) {
		if (_this->shared) {
			// merge files in the image and the shared directory
			image_lock(_this);
			hostdir_sync(_this->hostdir);
			image_unlock(_this);
		} else {
			// just save the image file
			if (_this->changed)
				result = image_save(_this);
		}
	}
	boolarray_clear(_this->changedblocks);
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0xf4(%rax)
je 0xa58b
movq -0x8(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0xa56e
movq -0x8(%rbp), %rdi
callq 0x9fe0
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0xbfd0
movq -0x8(%rbp), %rdi
callq 0xa000
jmp 0xa589
movq -0x8(%rbp), %rax
cmpb $0x0, 0xf5(%rax)
je 0xa587
movq -0x8(%rbp), %rdi
callq 0xa270
movl %eax, -0xc(%rbp)
jmp 0xa589
jmp 0xa58b
movq -0x8(%rbp), %rax
movq 0xf8(%rax), %rdi
callq 0xe3e0
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/image.c
// Function: image_destroy
void image_destroy(image_t *_this) {
	_this->open = 0;
	if (_this->host_fpath)
		free(_this->host_fpath);
	_this->host_fpath = NULL;
	if (_this->data)
		free(_this->data);
	_this->data = NULL;
	_this->data_size = 0;
	if (_this->shared) {
		if (_this->hostdir)
			hostdir_destroy(_this->hostdir);
		if (_this->pdp_filesystem)
			filesystem_destroy(_this->pdp_filesystem);
	}
	free(_this);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb $0x0, 0xf4(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0xa5df
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x3040
movq -0x8(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x118(%rax)
je 0xa609
movq -0x8(%rbp), %rax
movq 0x118(%rax), %rdi
callq 0x3040
movq -0x8(%rbp), %rax
movq $0x0, 0x118(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x110(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0xa66e
movq -0x8(%rbp), %rax
cmpq $0x0, 0xd8(%rax)
je 0xa64e
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0xbdb0
movq -0x8(%rbp), %rax
cmpq $0x0, 0xe0(%rax)
je 0xa66c
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rdi
callq 0xed80
jmp 0xa66e
movq -0x8(%rbp), %rdi
callq 0x3040
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/serial.c
// Function: serial_devtxinit
void serial_devtxinit(serial_device_t *serial) {
	// flush all output
	tcflush(serial->fd, TCOFLUSH);

	// reset send buffer
	serial->wcnt = 0;
	serial->wptr = serial->wbuf;

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
movl $0x1, %esi
callq 0x31b0
movq -0x8(%rbp), %rax
movl $0x0, 0x128(%rax)
movq -0x8(%rbp), %rcx
addq $0x20, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x120(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/serial.c
// Function: serial_devrxinit
void serial_devrxinit(serial_device_t *serial) {
	// flush all input
	tcflush(serial->fd, TCIFLUSH);

	// reset receive buffer
	serial->rcnt = 0;
	serial->rptr = serial->rbuf;

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
xorl %esi, %esi
callq 0x31b0
movq -0x8(%rbp), %rax
movl $0x0, 0x238(%rax)
movq -0x8(%rbp), %rcx
addq $0x12c, %rcx            # imm = 0x12C
movq -0x8(%rbp), %rax
movq %rcx, 0x230(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/serial.c
// Function: serial_devrxavail
int32_t serial_devrxavail(serial_device_t *serial) {
	// get more characters if none available
	if (serial->rcnt <= 0) {
		serial->rcnt = read(serial->fd, serial->rbuf, sizeof(serial->rbuf));
		serial->rptr = serial->rbuf;
	}
	if (serial->rcnt < 0)
		serial->rcnt = 0;

	// return characters available
	return serial->rcnt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x238(%rax)
jg 0xa7f6
movq -0x8(%rbp), %rax
movl (%rax), %edi
movq -0x8(%rbp), %rsi
addq $0x12c, %rsi            # imm = 0x12C
movl $0x100, %edx            # imm = 0x100
callq 0x32a0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x238(%rax)
movq -0x8(%rbp), %rcx
addq $0x12c, %rcx            # imm = 0x12C
movq -0x8(%rbp), %rax
movq %rcx, 0x230(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x238(%rax)
jge 0xa811
movq -0x8(%rbp), %rax
movl $0x0, 0x238(%rax)
movq -0x8(%rbp), %rax
movl 0x238(%rax), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/serial.c
// Function: serial_devtxwrite
int32_t serial_devtxwrite(serial_device_t *serial, uint8_t *buf, int32_t cnt) {
	// write characters if asked, return number written
	int32_t result = 0;
	if (cnt > 0) {
		// write is monolitic and may take long
		// make sure serial_tx_lasttime_ms doe not time out
		serial->tx_lasttime_ms = now_ms() + 60000; // signal busy: 1 minute in the future
		result = write(serial->fd, buf, cnt);
		serial->tx_lasttime_ms = now_ms(); // now up to date
	}
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x0, -0x14(%rbp)
jle 0xa891
movb $0x0, %al
callq 0xd2c0
movq %rax, %rcx
addq $0xea60, %rcx           # imm = 0xEA60
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
callq 0x3140
movl %eax, -0x18(%rbp)
movb $0x0, %al
callq 0xd2c0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/serial.c
// Function: serial_devtxflush
void serial_devtxflush(serial_device_t *serial) {
	int32_t acnt;

	// write any characters we have
	if (serial->wcnt > 0) {
		if ((acnt = serial_devtxwrite(serial, serial->wbuf, serial->wcnt)) != serial->wcnt)
			error("devtxflush(): write error, expected=%d, actual=%d", serial->wcnt, acnt);
	}

	// buffer is now empty
	serial->wcnt = 0;
	serial->wptr = serial->wbuf;

	// wait until all characters are transmitted
	tcdrain(serial->fd);

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x128(%rax)
jle 0xa900
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x20, %rsi
movq -0x8(%rbp), %rax
movl 0x128(%rax), %edx
callq 0xa830
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rcx
cmpl 0x128(%rcx), %eax
je 0xa8fe
movq -0x8(%rbp), %rax
movl 0x128(%rax), %esi
movl -0xc(%rbp), %edx
leaq 0x11869(%rip), %rdi     # 0x1c160
movb $0x0, %al
callq 0xce70
jmp 0xa900
movq -0x8(%rbp), %rax
movl $0x0, 0x128(%rax)
movq -0x8(%rbp), %rcx
addq $0x20, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x120(%rax)
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x3110
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/serial.c
// Function: serial_devrxget
uint8_t serial_devrxget(serial_device_t *serial) {
	// get more characters if none available
	while (serial_devrxavail(serial) <= 0)
		/*spin*/;

	serial->rx_lasttime_ms = now_ms(); // signal activity

	// count, return next character
	serial->rcnt--;
	return *(serial->rptr)++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xa7a0
cmpl $0x0, %eax
jg 0xa95c
jmp 0xa94c
movb $0x0, %al
callq 0xd2c0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movl 0x238(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x238(%rax)
movq -0x8(%rbp), %rcx
movq 0x230(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x230(%rcx)
movb (%rax), %al
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/serial.c
// Function: serial_devtxput
void serial_devtxput(serial_device_t *serial, uint8_t c) {

	// must flush if hit the end of the buffer
	if (serial->wcnt >= (int)sizeof(serial->wbuf))
		serial_devtxflush(serial);

	// count, add one character to buffer
	serial->wcnt++;
	*(serial->wptr)++ = c;

	serial->tx_lasttime_ms = now_ms(); // signal activity

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x100, 0x128(%rax)     # imm = 0x100
jl 0xa9db
movq -0x8(%rbp), %rdi
callq 0xa8a0
movq -0x8(%rbp), %rax
movl 0x128(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x128(%rax)
movb -0x9(%rbp), %cl
movq -0x8(%rbp), %rdx
movq 0x120(%rdx), %rax
movq %rax, %rsi
addq $0x1, %rsi
movq %rsi, 0x120(%rdx)
movb %cl, (%rax)
movb $0x0, %al
callq 0xd2c0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/serial.c
// Function: serial_decode_format
int serial_decode_format(char *formatstr, int *result_bitcount, char *result_parity,
		int *result_stopbits) {
	if (!formatstr || strlen(formatstr) != 3)
		return 1;
	switch (formatstr[0]) {
	case '5':
		*result_bitcount = 5 ;
		break ;
	case '6':
		*result_bitcount = 6 ;
		break ;
	case '7':
		*result_bitcount = 7 ;
		break ;
	case '8':
		*result_bitcount = 8 ;
		break ;
	default: return 1;
	}

	switch (toupper(formatstr[1])) {
	case 'O':
	case 'E':
	case 'N':
		*result_parity = toupper(formatstr[1]) ;
		break ;
	default: return 1;
	}

	switch (formatstr[2]) {
	case '1':
		*result_stopbits = 1 ;
		break ;
	case '2':
		*result_stopbits = 2 ;
		break ;
	default: return 1;
	}
	return 0 ; // all OK
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xaa5e
movq -0x10(%rbp), %rdi
callq 0x3190
cmpq $0x3, %rax
je 0xaa6a
movl $0x1, -0x4(%rbp)
jmp 0xab59
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
addl $-0x35, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x3, %eax
ja 0xaac3
movq -0x30(%rbp), %rax
leaq 0x116c6(%rip), %rcx     # 0x1c150
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movl $0x5, (%rax)
jmp 0xaacf
movq -0x18(%rbp), %rax
movl $0x6, (%rax)
jmp 0xaacf
movq -0x18(%rbp), %rax
movl $0x7, (%rax)
jmp 0xaacf
movq -0x18(%rbp), %rax
movl $0x8, (%rax)
jmp 0xaacf
movl $0x1, -0x4(%rbp)
jmp 0xab59
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %edi
callq 0x30e0
movl %eax, %ecx
movl %ecx, -0x34(%rbp)
subl $0x45, %eax
je 0xaaf5
jmp 0xaae8
movl -0x34(%rbp), %eax
addl $-0x4e, %eax
subl $0x1, %eax
ja 0xab0c
jmp 0xaaf5
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %edi
callq 0x30e0
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
jmp 0xab15
movl $0x1, -0x4(%rbp)
jmp 0xab59
movq -0x10(%rbp), %rax
movsbl 0x2(%rax), %eax
movl %eax, -0x38(%rbp)
subl $0x31, %eax
je 0xab31
jmp 0xab27
movl -0x38(%rbp), %eax
subl $0x32, %eax
je 0xab3d
jmp 0xab49
movq -0x28(%rbp), %rax
movl $0x1, (%rax)
jmp 0xab52
movq -0x28(%rbp), %rax
movl $0x2, (%rax)
jmp 0xab52
movl $0x1, -0x4(%rbp)
jmp 0xab59
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/serial.c
// Function: devbaud
static int32_t devbaud(int32_t rate) {
	static int32_t baudlist[] = { 3000000, B3000000, 2500000, B2500000, 2000000, B2000000,
			1500000, B1500000, 1152000, B1152000, 1000000, B1000000, 921600, B921600, 576000,
			B576000, 500000, B500000, 460800, B460800, 230400, B230400, 115200, B115200, 57600,
			B57600, 38400, B38400, 19200, B19200, 9600, B9600, 4800, B4800, 2400, B2400, 1200,
			B1200, 600, B600, 300, B300, -1, -1 };
#endif
	int32_t *p = baudlist;
	int32_t r;

	// search table for a baud rate match, return corresponding entry
	while ((r = *p++) != -1)
		if (r == rate)
			return *p;
		else
			p++;

	// not found ...
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
leaq 0x18762(%rip), %rax     # 0x23630
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x10(%rbp)
movl (%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $-0x1, %eax
je 0xaf0c
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jne 0xaefe
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0xaf13
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
jmp 0xaed2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/serial.c
// Function: serial_devrestore
void serial_devrestore(serial_device_t *serial) {
	tcsetattr(serial->fd, TCSANOW, &serial->lineSave);
	close(serial->fd);
	serial->fd = -1;
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
movq -0x8(%rbp), %rdx
addq $0x23c, %rdx            # imm = 0x23C
xorl %esi, %esi
callq 0x3480
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x3260
movq -0x8(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/serial.c
// Function: coninit
void coninit(int rawmode) {
	struct termios cons;

	// background mode, don't do anything
	if (opt_background)
		return;

	// get current console parameters
	if (tcgetattr(fileno(stdin), &consSave))
		fatal("stdin not a serial device");

	// copy modes
	cons = consSave;

	// set new modes
	if (rawmode) {
		cfmakeraw(&cons);
	} else {
		cons.c_lflag &= ~( ICANON | ECHO);
	}

	// now set param
	tcflush(fileno(stdin), TCIFLUSH);
	tcsetattr(fileno(stdin), TCSANOW, &cons);

	// set non-blocking reads
	if (fcntl(fileno(stdin), F_SETFL, FNDELAY) == -1)
		error("stdin failed to set non-blocking read");

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
leaq 0x18e0a(%rip), %rax     # 0x23d7c
cmpl $0x0, (%rax)
je 0xaf7c
jmp 0xb046
movq 0x18055(%rip), %rax     # 0x22fd8
movq (%rax), %rdi
callq 0x3360
movl %eax, %edi
leaq 0x1a4ac(%rip), %rsi     # 0x25440
callq 0x3470
cmpl $0x0, %eax
je 0xafac
leaq 0x11249(%rip), %rdi     # 0x1c1ee
movb $0x0, %al
callq 0xd140
leaq -0x40(%rbp), %rdi
leaq 0x1a489(%rip), %rsi     # 0x25440
movl $0x3c, %edx
callq 0x3330
cmpl $0x0, -0x4(%rbp)
je 0xafd2
leaq -0x40(%rbp), %rdi
callq 0x3420
jmp 0xafdb
movl -0x34(%rbp), %eax
andl $-0xb, %eax
movl %eax, -0x34(%rbp)
movq 0x17ff6(%rip), %rax     # 0x22fd8
movq (%rax), %rdi
callq 0x3360
movl %eax, %edi
xorl %esi, %esi
callq 0x31b0
movq 0x17fde(%rip), %rax     # 0x22fd8
movq (%rax), %rdi
callq 0x3360
movl %eax, %edi
xorl %esi, %esi
leaq -0x40(%rbp), %rdx
callq 0x3480
movq 0x17fc2(%rip), %rax     # 0x22fd8
movq (%rax), %rdi
callq 0x3360
movl %eax, %edi
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
movb $0x0, %al
callq 0x3120
cmpl $-0x1, %eax
jne 0xb044
leaq 0x111cb(%rip), %rdi     # 0x1c208
movb $0x0, %al
callq 0xce70
jmp 0xb046
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/serial.c
// Function: conrestore
void conrestore(void) {
	// background mode, don't do anything
	if (opt_background)
		return;

	// restore console mode to saved
	tcsetattr(fileno(stdin), TCSANOW, &consSave);
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x18d21(%rip), %rax     # 0x23d7c
cmpl $0x0, (%rax)
je 0xb062
jmp 0xb081
movq 0x17f6f(%rip), %rax     # 0x22fd8
movq (%rax), %rdi
callq 0x3360
movl %eax, %edi
xorl %esi, %esi
leaq 0x1a3c4(%rip), %rdx     # 0x25440
callq 0x3480
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/serial.c
// Function: conget
int32_t conget(void) {
	char buf[1];
	int32_t s;

	// background mode, don't return anything
	if (opt_background)
		return -1;

	// try to read at most one char (may be none)
	s = read(fileno(stdin), buf, sizeof(buf));

	// if got a char return it, else return -1
	return s == 1 ? *buf : -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x18cdd(%rip), %rax     # 0x23d7c
cmpl $0x0, (%rax)
je 0xb0ad
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xb0ee
movq 0x17f24(%rip), %rax     # 0x22fd8
movq (%rax), %rdi
callq 0x3360
movl %eax, %edi
leaq -0x5(%rbp), %rsi
movl $0x1, %edx
callq 0x32a0
movl %eax, -0xc(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0xb0de
movsbl -0x5(%rbp), %eax
movl %eax, -0x10(%rbp)
jmp 0xb0e8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x10(%rbp)
jmp 0xb0e8
movl -0x10(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: snapshot_file_find
hostdir_file_t *snapshot_file_find(hostdir_snapshot_t *_this, char *pdp_filename_ext) {
	int i;
	hostdir_file_t *result = NULL;
	for (i = 0; !result && i < _this->file_count; i++) {
		if (!strcasecmp(_this->file[i].pdp_filnam_ext_stream, pdp_filename_ext))
			result = &_this->file[i]; // found
	}
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x14(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x20(%rbp)
movb %al, -0x21(%rbp)
jne 0xb13b
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
setl %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0xb144
jmp 0xb18f
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
movslq -0x14(%rbp), %rax
imulq $0x150, %rax, %rax      # imm = 0x150
addq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x3050
cmpl $0x0, %eax
jne 0xb182
movq -0x8(%rbp), %rax
addq $0x10, %rax
movslq -0x14(%rbp), %rcx
imulq $0x150, %rcx, %rcx      # imm = 0x150
addq %rcx, %rax
movq %rax, -0x20(%rbp)
jmp 0xb184
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xb11f
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/j-hoppe[P]tu58fs/hostdir.c
// Function: snapshot_file_register
hostdir_file_t *snapshot_file_register(hostdir_snapshot_t *_this, char *pdp_filename_ext,
		hostdir_side_t side) {
	hostdir_file_t *result;
	result = snapshot_file_find(_this, pdp_filename_ext);
	if (result && result->state[OTHER_SIDE(side)] == fs_created) {
		// Special logic: if a file is create on both sides simultanuously
		// it is found by the 2nd side, because 1st side allocated it.
		// so do not create a 2nd time but mark as "created"
		// It ois NOT possible that the 1st side "created" and the 2nd side had the file before:
		// the snapshot shows only a synchronized state with same files on both sides.
		result->state[side] = fs_created;
	}
	if (!result) {
		assert(_this->file_count < HOSTDIR_MAX_FILES);
		result = &_this->file[_this->file_count++];
		memset(result, 0, sizeof(hostdir_file_t));
		strcpy(result->pdp_filnam_ext_stream, pdp_filename_ext);
		result->state[side] = fs_created;
		result->state[OTHER_SIDE(side)] = fs_missing;
	}
	return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xb100
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xb1fe
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmovel %edx, %ecx
movslq %ecx, %rcx
cmpl $0x3, 0x128(%rax,%rcx,4)
jne 0xb1fe
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
movl $0x3, 0x128(%rax,%rcx,4)
cmpq $0x0, -0x20(%rbp)
jne 0xb2b0
movq -0x8(%rbp), %rax
cmpl $0x3e8, 0x8(%rax)       # imm = 0x3E8
jge 0xb218
jmp 0xb237
leaq 0x1100f(%rip), %rdi     # 0x1c22e
leaq 0x1102e(%rip), %rsi     # 0x1c254
movl $0x78, %edx
leaq 0x1102c(%rip), %rcx     # 0x1c25e
callq 0x3200
movq -0x8(%rbp), %rax
addq $0x10, %rax
movq -0x8(%rbp), %rdx
movl 0x8(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x8(%rdx)
movslq %ecx, %rcx
imulq $0x150, %rcx, %rcx      # imm = 0x150
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x150, %edx            # imm = 0x150
callq 0x3220
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x30c0
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
movl $0x3, 0x128(%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmovel %edx, %ecx
movslq %ecx, %rcx
movl $0x1, 0x128(%rax,%rcx,4)
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)