LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/rt11.c
// Function: patch_dd_sys
static int patch_dd_sys(rt11_filesystem_t *_this, char *filnam, char*ext,
		rt11_blocknr_t blockcount) {
	rt11_file_t *f;
	f = rt11_filesystem_file_by_name(_this, filnam, ext);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, 0x4(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8c(%rdi), %r12d
xorl %r13d, %r13d
testl %r12d, %r12d
cmovlel %r13d, %r12d
leaq 0x6f87(%rip), %r15      # 0x156f0
cmpq %r13, %r12
je 0xe7c6
movq 0x90(%rbx,%r13,8), %rbp
leaq 0x2(%rbp), %rsi
movq %r14, %rdi
callq 0x3060
testl %eax, %eax
jne 0xe796
leaq 0x52(%rbp), %rsi
movq %r15, %rdi
callq 0x3060
testl %eax, %eax
je 0xe79b
incq %r13
jmp 0xe769
testq %rbp, %rbp
je 0xe7c6
cmpw $0x3, 0x7c(%rbp)
ja 0xe7d5
leaq 0x74a6(%rip), %rsi      # 0x15c54
pushq $-0x1
popq %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x982c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzwl 0x7a(%rbp), %esi
movzwl 0x4(%rsp), %ecx
pushq $0x2c
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf772
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_filesystem_print_dir
void rt11_filesystem_print_dir(rt11_filesystem_t *_this, FILE *stream) {
	int fileidx;
	char line[80];
	// no header
	line[0] = 0;
	for (fileidx = 0; fileidx < _this->file_count; fileidx++) {
		if (fileidx & 1) {
			// odd file #: right column, print
			strcat(line, "      ");
			strcat(line, rt11_dir_entry_text(_this, fileidx));
			fprintf(stream, "%s\n", line);
			line[0] = 0;
		} else {
			// even: left column
			strcpy(line, rt11_dir_entry_text(_this, fileidx));
		}
	}
	if (strlen(line)) // print pending left column
		fprintf(stream, "%s\n", line);
	fprintf(stream, " %d files, %d blocks\n", _this->file_count, _this->used_file_blocks);
	fprintf(stream, " %d Free blocks\n", _this->free_blocks);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
movb $0x0, (%r15)
leaq 0x3b43a(%rip), %r12     # 0x4a8d0
leaq 0x58f4(%rip), %r13      # 0x14d91
xorl %ebp, %ebp
movl 0x8c(%r14), %edx
cmpl %edx, %ebp
jge 0xf50b
testb $0x1, %bpl
jne 0xf4c7
movq %r14, %rdi
movl %ebp, %esi
callq 0xf56d
movq %r15, %rdi
movq %r12, %rsi
callq 0x30c0
jmp 0xf507
movq %r15, %rdi
callq 0x3190
movl $0x20202020, (%rsp,%rax) # imm = 0x20202020
movl $0x202020, 0x3(%rsp,%rax) # imm = 0x202020
movq %r14, %rdi
movl %ebp, %esi
callq 0xf56d
movq %r15, %rdi
movq %r12, %rsi
callq 0x3510
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3310
movb $0x0, (%rsp)
incl %ebp
jmp 0xf49f
cmpb $0x0, (%rsp)
je 0xf52c
leaq 0x5879(%rip), %rsi      # 0x14d91
movq %rsp, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3310
movl 0x8c(%r14), %edx
movzwl 0x1fd0(%r14), %ecx
leaq 0x6374(%rip), %rsi      # 0x158af
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3310
movzwl 0x1fd2(%r14), %edx
leaq 0x6371(%rip), %rsi      # 0x158c5
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3310
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_dir_entry_text
static char *rt11_dir_entry_text(rt11_filesystem_t *_this, int fileidx) {
	static char buff[80];
	rt11_file_t *f = _this->file[fileidx];
	sprintf(buff, "%6s.%-3s%6d%c %s", f->filnam, f->ext, f->block_count,
			f->readonly ? 'P' : ' ', rt11_date_text(f->date));
	return buff;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movslq %esi, %rax
movq 0x90(%rdi,%rax,8), %rax
leaq 0x2(%rax), %rbx
leaq 0x52(%rax), %r14
movzwl 0x7c(%rax), %ebp
cmpl $0x0, 0xd0(%rax)
pushq $0x20
popq %rcx
pushq $0x50
popq %r15
cmovel %ecx, %r15d
movslq 0xa8(%rax), %rcx
movl 0xa4(%rax), %edx
movl 0xac(%rax), %r8d
leaq 0x6a8b(%rip), %rax      # 0x16048
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
leaq 0x3b355(%rip), %r12     # 0x4a920
leaq 0x60d7(%rip), %rsi      # 0x156a9
movq %r12, %rdi
xorl %eax, %eax
callq 0x3530
movq %r12, (%rsp)
leaq 0x3b2e9(%rip), %rdi     # 0x4a8d0
leaq 0x6a19(%rip), %rsi      # 0x16007
movq %rbx, %rdx
movq %r14, %rcx
movl %ebp, %r8d
movl %r15d, %r9d
xorl %eax, %eax
callq 0x3530
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_filename_to_host
char *rt11_filename_to_host(char *filnam, char *ext, char *streamname) {
	static char result[80];
	char _filnam[80], _ext[80];
	// remove surrounding spaces.
	// all XXDP filename chars are valid host chars (" ", "$", "%")
	// return concat "filnam.ext"
	strcpy(_filnam, strtrim(filnam));
	strcpy(_ext, strtrim(ext));
	if (!strlen(_filnam))
		strcpy(_filnam, "_");
	strcpy(result, _filnam);
	if (strlen(_ext)) {
		strcat(result, ".");
		strcat(result, _ext);
	}
	if (streamname && strlen(streamname)) {
		strcat(result, ".");
		strcat(result, streamname);
	}

	return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xa0, %rsp
movq %rdx, %rbx
movq %rsi, %r14
callq 0x9ede
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x30c0
movq %r14, %rdi
callq 0x9ede
movq %rsp, %rdi
movq %rax, %rsi
callq 0x30c0
cmpb $0x0, (%r15)
jne 0xf65a
movw $0x5f, 0x50(%rsp)
leaq 0x268df(%rip), %r14     # 0x35f40
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x30c0
cmpb $0x0, (%rsp)
je 0xf68e
movq %r14, %rdi
callq 0x3190
movw $0x2e, (%rax,%r14)
movq %rsp, %rsi
movq %r14, %rdi
callq 0x3510
testq %rbx, %rbx
je 0xf6b2
cmpb $0x0, (%rbx)
je 0xf6b2
movq %r14, %rdi
callq 0x3190
movw $0x2e, (%rax,%r14)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3510
leaq 0x26887(%rip), %rax     # 0x35f40
addq $0xa0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/rt11.c
// Function: stream_destroy
static void stream_destroy(rt11_stream_t *stream) {
	if (stream) {
		if (stream->data)
			free(stream->data);
		free(stream);
	}
}

// Assembly:
testq %rdi, %rdi
je 0xf6e1
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x3050
movq %rbx, %rdi
popq %rbx
jmp 0x3050
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_filesystem_mark_filestream_as_changed
static void rt11_filesystem_mark_filestream_as_changed(rt11_filesystem_t *_this,
		rt11_stream_t *stream) {
	rt11_blocknr_t blknr, blkend;
	if (!stream)
		return;
	stream->changed = 0;
	if (_this->image_changed_blocks) {
		blkend = stream->blocknr + NEEDED_BLOCKS(RT11_BLOCKSIZE, stream->data_size);
		for (blknr = stream->blocknr; !stream->changed && blknr < blkend; blknr++)
			stream->changed |= BOOLARRAY_BIT_GET(_this->image_changed_blocks, blknr);
//		stream->changed |= boolarray_bit_get(_this->image_changed_blocks, blknr);
		// possible optimization: boolarray is tested sequentially
	}
}

// Assembly:
testq %rsi, %rsi
je 0xf771
movb $0x0, 0x64(%rsi)
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0xf771
movzwl (%rsi), %ecx
movl $0x1ff, %edx            # imm = 0x1FF
addl 0x10(%rsi), %edx
shrl $0x9, %edx
addl %ecx, %edx
movzwl %dx, %edx
xorl %edi, %edi
testb %dil, %dil
jne 0xf771
cmpl %edx, %ecx
jae 0xf771
movq (%rax), %rdi
movl %ecx, %r8d
shrl $0x5, %r8d
movl (%rdi,%r8,4), %edi
btl %ecx, %edi
setb %dil
setb 0x64(%rsi)
incl %ecx
jmp 0xf74b
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/rt11.c
// Function: rt11_image_set_word_at
static void rt11_image_set_word_at(rt11_filesystem_t *_this, rt11_blocknr_t blocknr,
		uint32_t byte_offset, uint16_t val) {
	uint32_t idx = RT11_BLOCKSIZE * blocknr + byte_offset;
	assert((idx + 1) < _this->image_size);

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

// Assembly:
shll $0x9, %esi
movl %edx, %eax
addq %rsi, %rax
leal 0x1(%rax), %edx
cmpl 0x8(%rdi), %edx
jae 0xf790
movq (%rdi), %rdx
movb %cl, (%rdx,%rax)
movq (%rdi), %rdx
movb %ch, 0x1(%rdx,%rax)
retq
pushq %rax
leaq 0x5b30(%rip), %rdi      # 0x152c8
leaq 0x5f95(%rip), %rsi      # 0x15734
leaq 0x63d0(%rip), %rcx      # 0x15b76
pushq $0x79
popq %rdx
callq 0x3200
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/monitor.c
// Function: monitor_getc
int monitor_getc(monitor_t *_this, int timeout_us) {
	char tmpbuff[2];
	int n;
	int timeout ;
	timeout_set(timeout_us);
	// "Busy waiting" loop, as delay() routines are unreliable under CygWin.
	do {
		// Fix for slow single thread CPUs (BBB):
		// test timeout BEFORE read()
		timeout = timeout_reached() ;
		fcntl(_this->serial->fd, F_SETFL, FNDELAY);
		tmpbuff[0] = 0; // clear
		n = read(_this->serial->fd, tmpbuff, 1);
//		if (n < 0)
//			return error_set(ERROR_MONITOR, "monitor_getc() failed with errno=%u", errno);
		if (n > 0) {
			// monitor_trace(tmpbuff, n, TRACE_IN, "monitor_getc") ;
			return tmpbuff[0];
		}
	} while (n <= 0 && !timeout);
	return EOF;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl %esi, %edi
callq 0x9cf1
pushq $0x4
popq %r14
leaq 0x6(%rsp), %r15
pushq $0x1
popq %r12
pushq $-0x1
popq %rbp
callq 0x9d08
movl %eax, %r13d
movq 0x10(%rbx), %rax
movl (%rax), %edi
movl %r14d, %esi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x3120
movb $0x0, 0x6(%rsp)
movq 0x10(%rbx), %rax
movl (%rax), %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x32b0
testl %eax, %eax
jg 0xfb26
testl %r13d, %r13d
je 0xfae8
jmp 0xfb2b
movsbl 0x6(%rsp), %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/monitor.c
// Function: monitor_puts
int monitor_puts(monitor_t *_this, char *s) {
	int n;
	n = strlen(s);
	n = write(_this->serial->fd, s, n);
	if (n < 0) {
		monitor_trace_dump(ferr);
		return error_set(ERROR_MONITOR, "serial_puts() failed");
	}
	monitor_trace(s, n, TRACE_OUT, "monitor_puts");
	return ERROR_OK;
	// do not echo output, PDP-11 should do this
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x3190
movq 0x10(%r14), %rcx
movl (%rcx), %edi
movslq %eax, %rdx
movq %rbx, %rsi
callq 0x3140
testl %eax, %eax
js 0xfba6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x652e(%rip), %rsi      # 0x160db
pushq $-0xa
popq %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x982c
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/monitor.c
// Function: monitor_wait_prompt
static int monitor_wait_prompt(monitor_t *_this, char *last_answer) {
	char buff[256];
	int rounds = 5;
	char *s;

	buff[0] = 0;
	if (last_answer)
		strcat(buff, last_answer);
monitor_trace(NULL, 0, TRACE_STATUS, "monitor_wait_prompt():responsetime_us=%u", _this->responsetime_us) ;
	do {
		s = monitor_gets(_this, _this->responsetime_us);
		if (s) {
			// append to buffer, clip off first chars
			int n = strlen(s);
			if (n + strlen(buff) + 1 >= sizeof(buff))
				memmove(buff, buff + n, sizeof(buff) - n);
			strcat(buff, s);
		}
		// find prompt in string
		if (strstr(buff, _this->prompt) != NULL)
			return ERROR_OK; // found
	} while (--rounds);

	monitor_trace_dump(ferr);
	return STATUS_MONITOR_NOPROMPT; // not found after timeout
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
movb $0x0, (%rsp)
testq %rsi, %rsi
je 0xfbe3
movq %rsp, %rdi
callq 0x3510
pushq $-0x5
popq %r12
leaq 0x3ad82(%rip), %r14     # 0x4a970
movq %rsp, %r15
pushq $0x1
popq %rbp
movl 0x18(%rbx), %esi
movq %rbx, %rdi
callq 0xfc70
movq %r14, %rdi
callq 0x3190
movslq %eax, %r13
movq %r15, %rdi
callq 0x3190
addq %r13, %rax
addq $-0xff, %rax
cmpq $-0x101, %rax           # imm = 0xFEFF
ja 0xfc37
leaq (%rsp,%r13), %rsi
movl $0x100, %edx            # imm = 0x100
subq %r13, %rdx
movq %r15, %rdi
callq 0x3460
movq %r15, %rdi
movq %r14, %rsi
callq 0x3510
movq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x35b0
testq %rax, %rax
jne 0xfc5a
incl %r12d
jne 0xfbf4
jmp 0xfc5c
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/monitor.c
// Function: monitor_gets
char *monitor_gets(monitor_t *_this, int timeout_us) {
	static char buffer[10240];
	unsigned charcount;
	int c;

	charcount = 0;
	buffer[0] = 0; // clear
	// "Busy waiting" loop, as delay() routines are unreliable under CygWin.
	do {
		c = monitor_getc(_this, timeout_us);
		if (c != EOF) {
			// append char to string, new timeout
			buffer[charcount++] = (char) c;
			buffer[charcount] = 0;
			if (charcount + 1 >= sizeof(buffer))
				fatal("monitor_gets(): buffer overflow");
			if (_this->fecho)
				fputc(c, _this->fecho);
			timeout_us = 3 * _this->chartime_us; // next chars full RS232 speed
		}
	} while (c != EOF);
	monitor_trace(buffer, charcount, TRACE_IN, "monitor_gets");

	return buffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movb $0x0, 0x3acee(%rip)     # 0x4a970
movl $0xffffd802, %r15d      # imm = 0xFFFFD802
leaq 0x3ace1(%rip), %r12     # 0x4a970
leaq 0x6425(%rip), %r14      # 0x160bb
movq %rbx, %rdi
callq 0xfac3
cmpl $-0x1, %eax
je 0xfcea
movl %eax, %ebp
leal 0x27fe(%r15), %eax
leal 0x27ff(%r15), %ecx
movl %eax, %eax
movb %bpl, (%rax,%r12)
movb $0x0, (%rcx,%r12)
cmpl $0xffffd7ff, %r15d      # imm = 0xFFFFD7FF
ja 0xfcd1
movq %r14, %rdi
xorl %eax, %eax
callq 0x9b87
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
je 0xfce1
movl %ebp, %edi
callq 0x3290
imull $0x3, 0x1c(%rbx), %esi
incl %r15d
jmp 0xfc96
leaq 0x3ac7f(%rip), %rax     # 0x4a970
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/monitor.c
// Function: monitor_go
int monitor_go(monitor_t *_this, unsigned address, int no_go) {
	switch (_this->monitor_type) {
	case monitor_odt:
		return monitor_odt_go(_this, address, no_go);
	case monitor_m9312:
	case monitor_m9301: // only difference is the prompt
		return monitor_m9312_go(_this, address, no_go);
        case monitor_1144:
            return monitor_1144_go(_this, address, no_go);
	default:
		return error_set(ERROR_MONITOR, "monitor_go(): Illegal boot monitor %u selected",
				_this->monitor_type);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %edx, %r14d
movl %esi, %eax
movq %rdi, %rbx
movl (%rdi), %edx
leal -0x3(%rdx), %ecx
cmpl $0x2, %ecx
jb 0x10117
cmpl $0x5, %edx
je 0x1016a
cmpl $0x2, %edx
jne 0x1019f
testl %r14d, %r14d
je 0x101bd
leaq 0x611b(%rip), %rsi      # 0x16210
movq %rsp, %r14
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x3530
movl 0x18(%rbx), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xfcfa
jmp 0x101f5
movq %rbx, %rdi
movl %eax, %esi
callq 0x10231
testl %eax, %eax
jne 0x10194
movl 0x18(%rbx), %edx
leaq 0x4689(%rip), %rsi      # 0x147b8
movq %rbx, %rdi
callq 0xfcfa
xorl %ebp, %ebp
testl %r14d, %r14d
jne 0x101f7
leaq 0x5f70(%rip), %rsi      # 0x160b9
movq %rbx, %rdi
callq 0xfb75
movl 0x18(%rbx), %esi
movq %rbx, %rdi
callq 0xfc70
cmpb $0x0, 0x3a80d(%rip)     # 0x4a970
jne 0x10151
jmp 0x101f7
leaq 0x6131(%rip), %rsi      # 0x162a2
xorl %ebp, %ebp
movq %rsp, %r15
movq %r15, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x3530
movl 0x18(%rbx), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xfcfa
testl %eax, %eax
je 0x10207
leaq 0xe09d(%rip), %rax      # 0x1e238
movl (%rax), %ebp
jmp 0x101f7
leaq 0x5ffe(%rip), %rsi      # 0x161a4
pushq $-0xa
popq %rdi
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x982c
leaq 0x60da(%rip), %rsi      # 0x1629e
movq %rsp, %r14
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x3530
movl 0x18(%rbx), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xfcfa
movl 0x18(%rbx), %esi
movq %rbx, %rdi
callq 0xfc70
cmpb $0x0, 0x3a77d(%rip)     # 0x4a970
jne 0x101e1
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
testl %r14d, %r14d
jne 0x101f7
leaq 0x5ea6(%rip), %rsi      # 0x160b9
movq %rbx, %rdi
callq 0xfb75
movl 0x18(%rbx), %esi
movq %rbx, %rdi
callq 0xfc70
cmpb $0x0, 0x3a743(%rip)     # 0x4a970
jne 0x1021b
jmp 0x101f7
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/monitor.c
// Function: monitor_m9312_load_addr
static int monitor_m9312_load_addr(monitor_t *_this, unsigned address) {
	char buffer[256];
	char *answer;
	_this->last_address = 0xffffffff; // invalidate
	sprintf(buffer, "L %o", address);
	if (monitor_puts_echocheck(_this, buffer, _this->responsetime_us)) // verify address
		return error_code;
	monitor_puts(_this, CR);
	answer = monitor_gets(_this, _this->responsetime_us); // read prompt
	if (monitor_wait_prompt(_this, answer))
		return error_set(ERROR_MONITOR, "M9312/M9301 address load: %s-prompt not found",
				_this->prompt);
	_this->last_address = address;
	return ERROR_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movl %esi, %ebp
movq %rdi, %rbx
orl $-0x1, 0x28(%rdi)
leaq 0x5ff0(%rip), %rsi      # 0x1623c
movq %rsp, %r14
movq %r14, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3530
movl 0x18(%rbx), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xfcfa
testl %eax, %eax
je 0x10278
leaq 0xdfc4(%rip), %rax      # 0x1e238
movl (%rax), %eax
jmp 0x102c1
leaq 0x5e3a(%rip), %rsi      # 0x160b9
movq %rbx, %rdi
callq 0xfb75
movl 0x18(%rbx), %esi
movq %rbx, %rdi
callq 0xfc70
leaq 0x3a6d7(%rip), %rsi     # 0x4a970
movq %rbx, %rdi
callq 0xfbbe
testl %eax, %eax
je 0x102bc
movq 0x8(%rbx), %rdx
leaq 0x5f91(%rip), %rsi      # 0x16241
pushq $-0xa
popq %rdi
xorl %eax, %eax
callq 0x982c
jmp 0x102c1
movl %ebp, 0x28(%rbx)
xorl %eax, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/bootloader.c
// Function: bootloader_show_code
void bootloader_show_code(FILE *fout, int opt_boot_address) {
	unsigned i;
	fprintf(fout, "# TU58 boot loader octal address/value dump\n");
	// dump out address/value pairs
	for (i = 0; i < obj_code_word_count; i++) {
		unsigned addr = opt_boot_address + 2 * i;
		unsigned value = obj_code[i];
		fprintf(fout, "%06o %06o\n", addr, value);
	}
	fprintf(fout, "\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x5fd1(%rip), %rdi      # 0x162b8
pushq $0x2c
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x3550
movl %ebp, %r15d
leaq 0x61c1(%rip), %r12      # 0x164c0
leaq 0x5fdf(%rip), %r14      # 0x162e5
xorl %r13d, %r13d
cmpq $0x56, %r13
je 0x1032c
leal (%r15,%r13), %edx
movzwl (%r13,%r12), %ecx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x3310
addq $0x2, %r13
jmp 0x10309
pushq $0xa
popq %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3290
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/bootloader.c
// Function: bootloader_download
int bootloader_download(serial_device_t *serialdevice, monitor_type_t monitor_type,
		int opt_boot_address) {
	monitor_t monitor;
	unsigned i;

	if (monitor_init(&monitor, serialdevice, monitor_type, stdout, opt_usbdelay))
		return error_set(ERROR_MONITOR, "monitor_init in bootloader_download");
	if (monitor_assert_prompt(&monitor))
		return error_set(ERROR_MONITOR,
				"Boot loader download: PDP-11 console prompt not found.");

	// dump out address/value pairs
	for (i = 0; i < obj_code_word_count; i++) {
		unsigned addr = opt_boot_address + 2 * i;
		unsigned value = obj_code[i];
		if (monitor_deposit(&monitor, addr, value))
			return error_set(ERROR_MONITOR, "bootloader_download");
	}
//monitor_trace_dump(stderr) ; //debug
	monitor_close(&monitor);
	return ERROR_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebx
movl %esi, %edx
movq %rdi, %rsi
movq 0xbc72(%rip), %rax      # 0x1bfd0
movq (%rax), %rcx
leaq 0xc71c(%rip), %rax      # 0x1ca84
movl (%rax), %r8d
leaq 0x8(%rsp), %rdi
callq 0xfa60
testl %eax, %eax
je 0x10382
leaq 0x5f70(%rip), %rsi      # 0x162f0
jmp 0x103d1
leaq 0x8(%rsp), %rdi
callq 0xfb3c
testl %eax, %eax
je 0x10399
leaq 0x5f7d(%rip), %rsi      # 0x16314
jmp 0x103d1
movl %ebx, %r14d
xorl %r15d, %r15d
leaq 0x611a(%rip), %r12      # 0x164c0
leaq 0x8(%rsp), %rbx
cmpq $0x56, %r15
je 0x103e7
leal (%r14,%r15), %esi
movzwl (%r15,%r12), %edx
movq %rbx, %rdi
callq 0xfe6a
addq $0x2, %r15
testl %eax, %eax
je 0x103ab
leaq 0x5f2f(%rip), %rsi      # 0x16300
pushq $-0xa
popq %rdi
xorl %eax, %eax
callq 0x982c
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x8(%rsp), %rdi
callq 0xfac0
xorl %eax, %eax
jmp 0x103db
// File: /workspace/github_c_makefile_star2_O2/j-hoppe[P]tu58fs/bootloader.c
// Function: bootloader_go
int bootloader_go(serial_device_t *serialdevice, monitor_type_t monitor_type, int boot_address) {
	monitor_t monitor;
	if (monitor_init(&monitor, serialdevice, monitor_type, stdout, opt_usbdelay))
		return error_set(ERROR_MONITOR, "monitor_init in bootloader_go");
	if (monitor_assert_prompt(&monitor))
		return error_set(ERROR_MONITOR, "monitor_assert_prompt in bootloader_go");
	if (monitor_go(&monitor, boot_address, 0))
		return error_set(ERROR_MONITOR, "monitor_go in bootloader_go");
	return ERROR_OK;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebx
movl %esi, %edx
movq %rdi, %rsi
movq 0xbbc7(%rip), %rax      # 0x1bfd0
movq (%rax), %rcx
leaq 0xc671(%rip), %rax      # 0x1ca84
movl (%rax), %r8d
leaq 0x8(%rsp), %rdi
callq 0xfa60
testl %eax, %eax
je 0x1042d
leaq 0x5f20(%rip), %rsi      # 0x1634b
jmp 0x1045f
leaq 0x8(%rsp), %rdi
callq 0xfb3c
testl %eax, %eax
je 0x10444
leaq 0x5f27(%rip), %rsi      # 0x16369
jmp 0x1045f
leaq 0x8(%rsp), %rdi
xorl %ebp, %ebp
movl %ebx, %esi
xorl %edx, %edx
callq 0x100b4
testl %eax, %eax
je 0x1046b
leaq 0x5f31(%rip), %rsi      # 0x16390
pushq $-0xa
popq %rdi
xorl %eax, %eax
callq 0x982c
movl %eax, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/thread.c
// Function: main
int main(void)
{
    pthread_t   launchers[NUM_LAUNCHERS];

    int i;

    try
    {
        for (i = 0; i < NUM_LAUNCHERS; i++)
        {
            pthread_create(&launchers[i], NULL, launch, (void *)0);
        }
    
        for (i = 0; i < NUM_LAUNCHERS; i++)
        {
            pthread_join(launchers[i], NULL);
        }
    }
    catch(Throwable, e)
    {
        e->printTryTrace(0);
    }
    finally;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
leaq 0x5fbf(%rip), %r15      # 0x7230
movq (%r15), %rdi
leaq 0x2d89(%rip), %rsi      # 0x4004
pushq $0x14
popq %rdx
callq 0x18a4
leaq 0x5f9a(%rip), %r14      # 0x7224
xorl %r13d, %r13d
movl %r13d, %eax
movq %rax, 0x8(%rsp)
leaq 0x1a0(%rip), %r12       # 0x143c
movq (%r15), %rdi
callq 0x164c
movq %rax, %rbp
movq %rax, %rdi
movq %r14, %rsi
leaq 0x2d50(%rip), %rdx      # 0x4004
pushq $0x14
popq %rcx
callq 0x1edf
testl %eax, %eax
je 0x12e1
movq (%rbp), %rdi
cmpl $0x0, 0x1b4(%rdi)
je 0x12e1
addq $0x8, %rdi
pushq $0x1
popq %rsi
callq 0x1130
testl %eax, %eax
je 0x1387
movq %rbp, %rdi
movq %r14, %rsi
leaq 0x5dd2(%rip), %rdx      # 0x70c0
leaq 0x2d0f(%rip), %rcx      # 0x4004
pushq $0x20
popq %r8
callq 0x1f73
testl %eax, %eax
je 0x1347
movq (%rbp), %rax
cmpl $0x0, 0x1b4(%rax)
je 0x1347
movq %rbp, %rdi
leaq 0x5da7(%rip), %rsi      # 0x70c0
callq 0x1c23
testl %eax, %eax
je 0x1347
movq 0x8(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x22be
movq (%rbp), %rcx
movl $0x2, 0x1b8(%rcx)
movq 0x8(%rsp), %rdi
callq *0x1f0(%rax)
cmpl $0x0, 0x5ed6(%rip)      # 0x7224
je 0x129c
movq (%rbp), %rdi
cmpl $0x0, 0x1b4(%rdi)
jne 0x13d5
addq $0xd0, %rdi
pushq $0x1
popq %rsi
callq 0x1130
testl %eax, %eax
jne 0x13d5
movq (%rbp), %rax
movl $0x1, 0x1b4(%rax)
jmp 0x129c
movq (%rbp), %rax
movl $0x1, 0x1b8(%rax)
movl %r13d, %ebx
cmpq $0x50, %rbx
je 0x13ba
leaq (%rsp,%rbx), %rdi
addq $0x10, %rdi
movl %r13d, %ecx
movq %rcx, %rsi
movq %r12, %rdx
callq 0x10e0
addq $0x8, %rbx
jmp 0x1398
movl %r13d, %ebx
cmpq $0xa, %rbx
je 0x1347
movq 0x10(%rsp,%rbx,8), %rdi
movl %r13d, %esi
callq 0x1120
incq %rbx
jmp 0x13bd
movq (%r15), %rdi
callq 0x164c
movq (%rax), %rax
movl $0x3, 0x1b8(%rax)
movq (%r15), %rdi
callq 0x164c
movq (%rax), %rax
cmpl $0x0, 0x1b4(%rax)
jg 0x140a
movq (%r15), %rdi
callq 0x1c91
testl %eax, %eax
je 0x142b
movq (%r15), %rdi
callq 0x164c
movq (%rax), %rax
movl 0x1b4(%rax), %ecx
movl %ecx, %edx
decl %edx
movl %edx, 0x1b4(%rax)
testl %ecx, %ecx
jg 0x140a
jmp 0x13ea
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/thread.c
// Function: launch
void *launch(void *arg)
{
    pthread_t   threads[NUM_THREADS];
    int         i;

    for (i = 0; i < NUM_THREADS; i++)
    {
        pthread_create(&threads[i], NULL, thread, (void *)0);
    }

    for (i = 0; i < NUM_THREADS; i++)
    {
        pthread_join(threads[i], NULL);
    }   
    printf("launch: reporting that all %d threads have terminated\n", i);

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
xorl %r14d, %r14d
leaq 0x4f(%rip), %rbx        # 0x149c
cmpq $0x50, %r14
je 0x1469
leaq (%rsp,%r14), %rdi
xorl %esi, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x10e0
addq $0x8, %r14
jmp 0x144d
xorl %ebx, %ebx
cmpq $0xa, %rbx
je 0x1481
movq (%rsp,%rbx,8), %rdi
xorl %esi, %esi
callq 0x1120
incq %rbx
jmp 0x146b
leaq 0x2b85(%rip), %rdi      # 0x400d
pushq $0xa
popq %rsi
xorl %eax, %eax
callq 0x1060
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Except.c
// Function: ExceptGetScope
Scope ExceptGetScope(
    Context *   pC)             /* pointer to thread exception context */
{
    Scope       scope;

    if (pC == NULL)
        pC = ExceptGetContext(NULL);

    ExceptPrintDebug(pC, "ExceptGetScope");

    if (pC == NULL || pC->pEx == NULL)
        scope = OUTSIDE;
    else
        scope = ((Except *)LifoPeek(pC->exStack, 1))->scope;

    return scope;
}

// Assembly:
pushq %rbx
pushq $-0x1
popq %rbx
testq %rdi, %rdi
jne 0x1630
xorl %edi, %edi
callq 0x164c
movq %rax, %rdi
testq %rax, %rax
je 0x1648
cmpq $0x0, (%rdi)
je 0x1648
movq 0x8(%rdi), %rdi
pushq $0x1
popq %rsi
callq 0x22be
movl 0x1b8(%rax), %ebx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Except.c
// Function: ExceptGetContext
Context * ExceptGetContext(
    Context *   pC)             /* pointer to thread exception context */
{
#if     MULTI_THREADING
    EXCEPT_THREAD_MUTEX_FUNC(1);
    if (pC == NULL && pContextHash != NULL)
        pC = HashLookup(pContextHash, EXCEPT_THREAD_ID_FUNC());
    EXCEPT_THREAD_MUTEX_FUNC(0);
    
    return pC;
#else
    return &defaultContext;
#endif
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rdi
callq 0x1699
testq %rbx, %rbx
sete %al
movq 0x5bd0(%rip), %r14      # 0x7238
testq %r14, %r14
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1687
callq 0x10f0
movq %r14, %rdi
movl %eax, %esi
callq 0x2692
movq %rax, %rbx
xorl %edi, %edi
callq 0x1699
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Except.c
// Function: ExceptMutex
static void ExceptMutex(
    int         mode)           /* 1: lock, 0 unlock */
{
    static volatile pthread_mutex_t mutex;
    static volatile sig_atomic_t    initialized;
    static volatile sig_atomic_t    ready;
    static volatile int             count;
    static volatile pthread_t       tid;

    if (!initialized && !initialized++)
    {
        pthread_mutex_init(&mutex, NULL);
        ready = 1;
    }
    else
    {
        while (!ready)
            ;
    }
    
    if (mode == 1)
    {
        if (tid == pthread_self())
        {
            count++;
        }
        else
        {
            pthread_mutex_lock(&mutex);
            tid = pthread_self();
            count = 1;
        }
    }
    else if (mode == 0)
    {
        if (tid == pthread_self())
        {
            if (--count == 0)
            {
                tid = 0;
                pthread_mutex_unlock(&mutex);
            }
        }
        else if (tid != 0 && tid != pthread_self())
        {
            fprintf(stderr, "Except internal error: thread attempts to unlock"
                            " without holding lock\n");
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %ebx
cmpl $0x0, 0x5bc1(%rip)      # 0x7268
jne 0x16c0
movl 0x5bb9(%rip), %eax      # 0x7268
leal 0x1(%rax), %ecx
movl %ecx, 0x5bb0(%rip)      # 0x7268
testl %eax, %eax
je 0x174e
cmpl $0x0, 0x5ba5(%rip)      # 0x726c
je 0x16c0
movq 0x5ba8(%rip), %r15      # 0x7278
callq 0x10f0
movq %rax, %r14
cmpl $0x1, %ebx
jne 0x16ea
cmpq %r14, %r15
jne 0x1713
incl 0x5b88(%rip)            # 0x7270
jmp 0x1748
cmpq %r14, %r15
jne 0x1732
decl 0x5b7b(%rip)            # 0x7270
jne 0x1748
movq $0x0, 0x5b76(%rip) # 0x7278
leaq 0x5b37(%rip), %rdi      # 0x7240
popq %rbx
popq %r14
popq %r15
jmp 0x10b0
leaq 0x5b26(%rip), %rdi      # 0x7240
callq 0x1150
movq %r14, 0x5b52(%rip)      # 0x7278
movl $0x1, 0x5b40(%rip)      # 0x7270
jmp 0x1748
cmpq $0x0, 0x5b3e(%rip)      # 0x7278
je 0x1748
movq 0x5b35(%rip), %rax      # 0x7278
cmpq %r14, %rax
jne 0x176b
popq %rbx
popq %r14
popq %r15
retq
leaq 0x5aeb(%rip), %rdi      # 0x7240
xorl %esi, %esi
callq 0x1140
movl $0x1, 0x5b06(%rip)      # 0x726c
jmp 0x16c9
movq 0x5886(%rip), %rax      # 0x6ff8
movq (%rax), %rcx
leaq 0x2a65(%rip), %rdi      # 0x41e1
pushq $0x46
popq %rsi
pushq $0x1
popq %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x1110
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Except.c
// Function: ExceptThreadCleanup
void ExceptThreadCleanup(
    int         threadId)       /* ID of ceased thread or -1 for self */
{
#if     MULTI_THREADING
    validate(threadId != EXCEPT_THREAD_ID_FUNC(), NOTHING);
    if (threadId == -1)
        threadId = EXCEPT_THREAD_ID_FUNC();

    EXCEPT_THREAD_MUTEX_FUNC(1);
    if (pContextHash != NULL)
    {
        Context * pC;
        
        pC = HashLookup(pContextHash, threadId);
        if (pC != NULL)
        {
            ExceptRestoreHandlers(pC);
            LifoDestroyData(pC->exStack);
            if (pC->pEx->checkList != NULL)
                ListDestroyData(pC->pEx->checkList);
            free(HashRemove(pContextHash, threadId));
        }
    }    
    EXCEPT_THREAD_MUTEX_FUNC(0);
#endif
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edi, %ebp
callq 0x10f0
movq %rax, %rbx
cmpl %ebp, %ebx
jne 0x17c4
movq 0x5a8b(%rip), %rdi      # 0x7230
leaq 0x292a(%rip), %rdx      # 0x40d6
leaq 0x2943(%rip), %rcx      # 0x40f6
xorl %esi, %esi
movl $0x2c6, %r8d            # imm = 0x2C6
popq %rbx
popq %r14
popq %rbp
jmp 0x23ec
cmpl $-0x1, %ebp
cmovnel %ebp, %ebx
pushq $0x1
popq %rdi
callq 0x1699
movq 0x5a5f(%rip), %rdi      # 0x7238
testq %rdi, %rdi
je 0x1825
movl %ebx, %esi
callq 0x2692
testq %rax, %rax
je 0x1825
movq %rax, %r14
callq 0x1830
movq 0x8(%r14), %rdi
callq 0x211b
movq (%r14), %rax
movq 0x1c0(%rax), %rdi
testq %rdi, %rdi
je 0x180f
callq 0x2908
movq 0x5a22(%rip), %rdi      # 0x7238
movl %ebx, %esi
callq 0x279f
movq %rax, %rdi
callq 0x1040
xorl %edi, %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x1699
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Except.c
// Function: ExceptRestoreHandlers
static int ExceptRestoreHandlers(
    Context *   pC)             /* pointer to thread exception context */
{
    int restored = 0;

    EXCEPT_THREAD_MUTEX_FUNC(1);
    if (MULTI_THREADING && SHARE_HANDLERS && --numThreadsTry == 0)
    {
        signal(SIGABRT, sharedSigAbrtHandler);
        signal(SIGFPE,  sharedSigFpeHandler);
        signal(SIGILL,  sharedSigIllHandler);
        signal(SIGSEGV, sharedSigSegvHandler);
#ifdef  SIGBUS
        signal(SIGBUS,  sharedSigBusHandler);
#endif

        restored = 1;
    }
    else if (!MULTI_THREADING || !SHARE_HANDLERS)
    {
        signal(SIGABRT, pC->sigAbrtHandler);
        signal(SIGFPE,  pC->sigFpeHandler);
        signal(SIGILL,  pC->sigIllHandler);
        signal(SIGSEGV, pC->sigSegvHandler);
#ifdef  SIGBUS
        signal(SIGBUS,  pC->sigBusHandler);
#endif

        restored = 1;
    }
    EXCEPT_THREAD_MUTEX_FUNC(0);
    
    return restored;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x1
popq %rbx
movl %ebx, %edi
callq 0x1699
xorl %ebp, %ebp
decl 0x5a3b(%rip)            # 0x7280
jne 0x1894
movq 0x5a3a(%rip), %rsi      # 0x7288
pushq $0x6
popq %rdi
callq 0x1090
movq 0x5a33(%rip), %rsi      # 0x7290
pushq $0x8
popq %rdi
callq 0x1090
movq 0x5a2c(%rip), %rsi      # 0x7298
pushq $0x4
popq %rdi
callq 0x1090
movq 0x5a25(%rip), %rsi      # 0x72a0
pushq $0xb
popq %rdi
callq 0x1090
movq 0x5a1e(%rip), %rsi      # 0x72a8
pushq $0x7
popq %rdi
callq 0x1090
movl %ebx, %ebp
xorl %edi, %edi
callq 0x1699
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Except.c
// Function: ExceptTry
void ExceptTry(
    Context *   pC,             /* pointer to thread exception context */
    char *      file,           /* source file name */
    int         line)           /* source line number */
{
    int first;
    
#if     MULTI_THREADING
    EXCEPT_THREAD_MUTEX_FUNC(1);
    if (pContextHash == NULL)
        pContextHash = HashCreate();
    EXCEPT_THREAD_MUTEX_FUNC(0);
#endif
  
    if (first = (pC == NULL))
        pC = ExceptGetContext(NULL);
    if (pC == NULL)                     /* not needed for single-threading */
        pC = ExceptCreateContext();
  
    ExceptInstallHandlers(pC);

    LifoPush(pC->exStack, pC->pEx = calloc(sizeof(Except), 1));
    pC->pEx->first = first; 
    pC->pEx->tryFile = file;
    pC->pEx->tryLine = line;
    
    ExceptPrintDebug(pC, "ExceptTry");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %rdi
callq 0x1699
cmpq $0x0, 0x5971(%rip)      # 0x7238
jne 0x18d5
callq 0x2564
movq %rax, 0x5963(%rip)      # 0x7238
xorl %edi, %edi
callq 0x1699
movq %r15, %r12
testq %r15, %r15
jne 0x1934
xorl %edi, %edi
callq 0x164c
movq %rax, %r12
testq %rax, %rax
jne 0x1934
pushq $0x1
popq %rdi
movl $0x438, %esi            # imm = 0x438
callq 0x1080
movq %rax, %r12
testq %rax, %rax
je 0x1a1f
pushq $0x1
popq %rdi
callq 0x1699
movq 0x591d(%rip), %r13      # 0x7238
callq 0x10f0
movq %r13, %rdi
movl %eax, %esi
movq %r12, %rdx
callq 0x2707
xorl %edi, %edi
callq 0x1699
movq 0x8(%r12), %r13
testq %r13, %r13
jne 0x19d4
callq 0x20b8
movq %rax, 0x8(%r12)
pushq $0x1
popq %rdi
callq 0x1699
movl 0x5926(%rip), %eax      # 0x7280
leal 0x1(%rax), %ecx
movl %ecx, 0x591d(%rip)      # 0x7280
testl %eax, %eax
jne 0x19c8
leaq 0x6f7(%rip), %r13       # 0x2065
pushq $0x6
popq %rdi
movq %r13, %rsi
callq 0x1090
movq %rax, 0x5908(%rip)      # 0x7288
pushq $0x8
popq %rdi
movq %r13, %rsi
callq 0x1090
movq %rax, 0x58fe(%rip)      # 0x7290
pushq $0x4
popq %rdi
movq %r13, %rsi
callq 0x1090
movq %rax, 0x58f4(%rip)      # 0x7298
pushq $0xb
popq %rdi
movq %r13, %rsi
callq 0x1090
movq %rax, 0x58ea(%rip)      # 0x72a0
pushq $0x7
popq %rdi
movq %r13, %rsi
callq 0x1090
movq %rax, 0x58e0(%rip)      # 0x72a8
xorl %edi, %edi
callq 0x1699
movq 0x8(%r12), %r13
xorl %ebp, %ebp
testq %r15, %r15
sete %bpl
pushq $0x1
popq %rsi
movl $0x1f8, %edi            # imm = 0x1F8
callq 0x1080
movq %rax, (%r12)
movq %r13, %rdi
movq %rax, %rsi
callq 0x2172
movq (%r12), %rax
movl %ebp, 0x1bc(%rax)
movq %r14, 0x1c8(%rax)
movl %ebx, 0x1d0(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x55d2(%rip), %rax      # 0x6ff8
movq (%rax), %rcx
leaq 0x27f8(%rip), %rdi      # 0x4228
pushq $0x26
popq %rsi
pushq $0x1
popq %rdx
callq 0x1110
jmp 0x190c
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Except.c
// Function: ExceptThrow
void ExceptThrow(
    Context *   pC,             /* pointer to thread exception context */
    void *      pExceptOrClass, /* rethrown exception OR class to be catched */
    void *      pData,          /* pointer to associated data or NULL */
    char *      file,           /* name of source file where invoked */
    int         line)           /* source file line number */
{
    ExceptPrintDebug(pC, "ExceptThrow");

    if (pC == NULL)
        pC = ExceptGetContext(NULL);

    if (pC == NULL || pC->exStack == NULL || LifoCount(pC->exStack) == 0)
    {
        fprintf(stderr, "%s lost: file \"%s\", line %d.\n",
                ((ClassRef)pExceptOrClass)->name, file, line);
    
        return;
    }
    
    if (((ClassRef)pExceptOrClass)->notRethrown)
    {
        pC->pEx->class         = (ClassRef)pExceptOrClass;
        pC->pEx->pData         = pData;
        pC->pEx->file          = file;
        pC->pEx->line          = line;
        pC->pEx->getMessage    = ExceptGetMessage;
        pC->pEx->getData       = ExceptGetData;
        pC->pEx->printTryTrace = ExceptPrintTryTrace;
    }
    pC->pEx->state = PENDING;   /* in case of throw() inside 'catch' */

    switch (pC->pEx->scope)
    {
    case TRY:
        ExceptPrintDebug(pC, "longjmp(throwBuf)");
        LONGJMP(pC->pEx->throwBuf, 1);

    case CATCH:
        ExceptPrintDebug(pC, "longjmp(finalBuf)");
        LONGJMP(pC->pEx->finalBuf, 1);

    case FINALLY:
        ExceptPrintDebug(pC, "longjmp(finalBuf)");
        LONGJMP(pC->pEx->finalBuf, 1);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r13
testq %rdi, %rdi
jne 0x1a70
xorl %edi, %edi
callq 0x164c
movq %rax, %r13
testq %rax, %rax
je 0x1af7
movq 0x8(%r13), %rdi
testq %rdi, %rdi
je 0x1af7
callq 0x23b8
testl %eax, %eax
je 0x1af7
cmpl $0x0, (%r15)
movq (%r13), %rdi
je 0x1ad1
movq %r15, 0x198(%rdi)
movq %r12, 0x1a0(%rdi)
movq %r14, 0x1a8(%rdi)
movl %ebx, 0x1b0(%rdi)
leaq 0x89(%rip), %rax        # 0x1b37
movq %rax, 0x1e0(%rdi)
leaq 0xbc(%rip), %rax        # 0x1b78
movq %rax, 0x1e8(%rdi)
leaq 0xc2(%rip), %rax        # 0x1b8c
movq %rax, 0x1f0(%rdi)
movl $0x1, 0x4(%rdi)
movl 0x1b8(%rdi), %eax
cmpl $0x3, %eax
je 0x1b22
cmpl $0x2, %eax
je 0x1b22
cmpl $0x1, %eax
je 0x1b2b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x54fa(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
movq 0x10(%r15), %rdx
leaq 0x25f3(%rip), %rsi      # 0x40ff
movq %r14, %rcx
movl %ebx, %r8d
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x10a0
addq $0xd0, %rdi
jmp 0x1b2f
addq $0x8, %rdi
pushq $0x1
popq %rsi
callq 0x1070
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Except.c
// Function: ExceptGetMessage
static char * ExceptGetMessage(void)
{
    Context *   pC = ExceptGetContext(NULL);

    ExceptPrintDebug(pC, "ExceptGetMessage");

    sprintf(pC->message, "%s: file \"%s\", line %d.",
            pC->pEx->class->name, pC->pEx->file, pC->pEx->line);

    return pC->message;
}

// Assembly:
pushq %rbx
xorl %edi, %edi
callq 0x164c
movq %rax, %rbx
movq (%rax), %rax
addq $0x10, %rbx
movq 0x198(%rax), %rdx
movq 0x1a8(%rax), %rcx
movq 0x10(%rdx), %rdx
movl 0x1b0(%rax), %r8d
leaq 0x26e8(%rip), %rsi      # 0x4251
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1100
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Except.c
// Function: ExceptPrintTryTrace
static void ExceptPrintTryTrace(
   FILE *       pFile)          /* stream to which is printed or NULL */
{
    Context *   pC = ExceptGetContext(NULL);
    int         n;
    
    ExceptPrintDebug(pC, "ExceptGetData");

    if (pFile == NULL)
        pFile = stderr;

#if     MULTI_THREADING
    fprintf(pFile, "%s occurred in thread %d:\n", pC->pEx->class->name,
            EXCEPT_THREAD_ID_FUNC());
#else
    fprintf(pFile, "%s occurred:\n", pC->pEx->class->name);
#endif

    for (n = 1; n <= LifoCount(pC->exStack); n++)
    {
        Except *    pEx = LifoPeek(pC->exStack, n);
        
        fprintf(pFile, "        in 'try' at %s:%d\n", pEx->tryFile, pEx->tryLine);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %edi, %edi
callq 0x164c
movq %rax, %r14
testq %rbx, %rbx
jne 0x1baf
movq 0x544c(%rip), %rax      # 0x6ff8
movq (%rax), %rbx
movq (%r14), %rax
movq 0x198(%rax), %rax
movq 0x10(%rax), %r15
callq 0x10f0
leaq 0x26a0(%rip), %rsi      # 0x4269
movq %rbx, %rdi
movq %r15, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x10a0
pushq $0x1
popq %rbp
leaq 0x26a2(%rip), %r15      # 0x4284
movq 0x8(%r14), %rdi
callq 0x23b8
cmpl %eax, %ebp
jg 0x1c18
movq 0x8(%r14), %rdi
movl %ebp, %esi
callq 0x22be
movq 0x1c8(%rax), %rdx
movl 0x1d0(%rax), %ecx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10a0
incl %ebp
jmp 0x1be2
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Except.c
// Function: ExceptCatch
int ExceptCatch(
    Context *   pC,             /* pointer to thread exception context */
    ClassRef    class)          /* pointer to occurred exception */
{
    ExceptPrintDebug(pC, "ExceptCatch");

    if (pC == NULL)
        pC = ExceptGetContext(NULL);

    if (pC->pEx->state == PENDING && ExceptIsDerived(pC->pEx->class, class))
        pC->pEx->state = CAUGHT;

    return pC->pEx->state == CAUGHT;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
testq %rdi, %rdi
jne 0x1c39
xorl %edi, %edi
callq 0x164c
movq %rax, %rdi
movq (%rdi), %r14
movl 0x4(%r14), %ecx
cmpl $0x1, %ecx
jne 0x1c67
movq 0x198(%r14), %rdi
movq %rbx, %rsi
callq 0x1c77
testl %eax, %eax
je 0x1c64
movl $0x2, 0x4(%r14)
pushq $0x2
jmp 0x1c66
pushq $0x1
popq %rcx
xorl %eax, %eax
cmpl $0x2, %ecx
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Except.c
// Function: ExceptReturn
void ExceptReturn(
    Context *   pC)             /* pointer to thread exception context */
{
    ExceptPrintDebug(pC, "ExceptReturn");

    if (pC == NULL)
        pC = ExceptGetContext(NULL);

    pC->pEx->class = ReturnEvent;       /* may overrule pending exception */
    pC->pEx->state = PENDING;           /* in case of return() inside 'catch' */
    ExceptPrintDebug(pC, "longjmp(finalBuf)");
        
    LONGJMP(pC->pEx->finalBuf, 1);
}

// Assembly:
pushq %rax
testq %rdi, %rdi
jne 0x1eb8
xorl %edi, %edi
callq 0x164c
movq %rax, %rdi
movq (%rdi), %rdi
leaq 0x533e(%rip), %rax      # 0x7200
movq %rax, 0x198(%rdi)
movl $0x1, 0x4(%rdi)
addq $0xd0, %rdi
pushq $0x1
popq %rsi
callq 0x1070
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Except.c
// Function: ExceptCheckBegin
int ExceptCheckBegin(
    Context *   pC,             /* pointer to thread exception context */
    int *       pChecked,       /* pointer to flag if finished checking */
    char *      file,           /* name of source file where invoked */
    int         line)           /* source file line number */
{
    ExceptPrintDebug(pC, "ExceptCheckBegin");

    if (pC->pEx->checkList == NULL && !*pChecked)
    {
        pC->pEx->checkList = ListCreate();
    }
    else
    {
        if (!*pChecked)
        {
            if (ListCount(pC->pEx->checkList) == 0)
            {
                fprintf(stderr,
                        "Warning: No catch clause(s): file \"%s\", line %d.\n",
                        file, line);
            }

            ListDestroyData(pC->pEx->checkList);
            pC->pEx->checkList = NULL;
            *pChecked = 1;
        }
    }

    return *pChecked;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movq 0x1c0(%rax), %rdi
movl (%rsi), %eax
testq %rdi, %rdi
je 0x1f34
testl %eax, %eax
jne 0x1f49
movl %ecx, %ebp
movq %rdx, %r15
callq 0x31a6
testl %eax, %eax
je 0x1f54
movq (%r14), %rax
movq 0x1c0(%rax), %rdi
callq 0x2908
movq (%r14), %rax
andq $0x0, 0x1c0(%rax)
movl $0x1, (%rbx)
pushq $0x1
popq %rax
jmp 0x1f49
testl %eax, %eax
jne 0x1f49
callq 0x286c
movq (%r14), %rcx
movq %rax, 0x1c0(%rcx)
movl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x509d(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x21b8(%rip), %rsi      # 0x411d
movq %r15, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x10a0
jmp 0x1f0f
// File: /workspace/github_c_makefile_star2_O2/meaning-matters[P]Except/Except.c
// Function: ExceptCheck
int ExceptCheck(
    Context *   pC,             /* pointer to thread exception context */
    int *       pChecked,       /* pointer to flag if finished checking */
    ClassRef    class,          /* next exception class to be checked */
    char *      file,           /* name of source file where invoked */
    int         line)           /* source file line number */
{
    typedef struct _Check
    {
        ClassRef        class;
        int             line;
    } Check;

    ExceptPrintDebug(pC, "ExceptCheck");

    if (!*pChecked)
    {
        Check * pCheck;

        pCheck = ListHead(pC->pEx->checkList);
        while (pCheck != NULL)                  /* breaked from */
        {
            if (class == pCheck->class)
            {
                fprintf(stderr, "Duplicate catch(%s): file \"%s\", line %d; "
                        "already caught at line %d.\n",
                        class->name, file, line, pCheck->line);
                break;
            }

            if (ExceptIsDerived(class, pCheck->class))
            {
                fprintf(stderr, "Superfluous catch(%s): file \"%s\", line %d; "
                        "already caught by %s at line %d.\n", class->name,
                        file, line, pCheck->class->name, pCheck->line);
                break;
            }

            pCheck = ListNext(pC->pEx->checkList);
        }

        if (pCheck == NULL)
        {
            pCheck = malloc(sizeof(Check));
            pCheck->class = class;
            pCheck->line  = line;
            ListAddTail(pC->pEx->checkList, pCheck);
        }
    }
    return *pChecked;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
cmpl $0x0, (%rsi)
jne 0x1ff9
movl %r8d, %ebp
movq %rdx, %r15
movq %rdi, %r12
movq %rcx, 0x10(%rsp)
movq (%rdi), %rax
movq 0x1c0(%rax), %rdi
callq 0x2f23
movq %rax, %r13
testq %rax, %rax
je 0x1fd8
movq (%r13), %r14
cmpq %r15, %r14
je 0x200a
movq %r15, %rdi
movq %r14, %rsi
callq 0x1c77
testl %eax, %eax
jne 0x2034
movq (%r12), %rax
movq 0x1c0(%rax), %rdi
callq 0x2ff5
jmp 0x1fa6
pushq $0x10
popq %rdi
callq 0x10c0
movq %r15, (%rax)
movl %ebp, 0x8(%rax)
movq (%r12), %rcx
movq 0x1c0(%rcx), %rdi
movq %rax, %rsi
callq 0x29d6
movl (%rbx), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4fe7(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
movq 0x10(%r15), %rdx
movl 0x8(%r13), %r9d
leaq 0x212c(%rip), %rsi      # 0x414f
movq 0x10(%rsp), %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x10a0
jmp 0x1ff9
movq 0x4fbd(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
movq 0x10(%r15), %rdx
movq 0x10(%r14), %r9
movl 0x8(%r13), %eax
movl %eax, (%rsp)
leaq 0x2140(%rip), %rsi      # 0x4194
movq 0x10(%rsp), %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x10a0
jmp 0x1ff9