LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/code.c
// Function: docode
void
docode(void)
{
	Inst *savepc;

	savepc = prog.pc;
	do {
		execute(N2(savepc));
		if (returning) {
			break;
		}
		if (continuing) {
			continuing = 0;
			continue;
		}
		if (breaking) {
			breaking = 0;
			break;
		}
	} while (cond(savepc->u.ip));
	if (!returning)
		prog.pc = N1(savepc)->u.ip;
}

// Assembly:
pushq %rbx
movq 0xb8f8(%rip), %rbx      # 0x102e8
movq (%rbx), %rax
movq (%rax), %rdi
callq 0x2d79
cmpb $0x0, 0xb90e(%rip)      # 0x10310
jne 0x4a54
cmpb $0x1, 0xb90d(%rip)      # 0x10318
jne 0x4a16
movb $0x0, 0xb904(%rip)      # 0x10318
jmp 0x4a1f
cmpb $0x1, 0xb8f7(%rip)      # 0x10314
je 0x4a3f
movq 0x10(%rbx), %rdi
callq 0x4a56
ucomisd 0x4640(%rip), %xmm0     # 0x9070
jne 0x49f0
jp 0x49f0
cmpb $0x0, 0xb8d5(%rip)      # 0x10310
je 0x4a46
jmp 0x4a54
movb $0x0, 0xb8ce(%rip)      # 0x10314
movq (%rbx), %rax
movq 0x10(%rax), %rax
movq %rax, 0xb894(%rip)      # 0x102e8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/code.c
// Function: whilecode
void
whilecode(void)
{
	Inst *savepc;

	savepc = prog.pc;
	while (cond(N2(savepc))) {
		execute(savepc->u.ip);
		if (returning) {
			break;
		}
		if (continuing) {
			continuing = 0;
			continue;
		}
		if (breaking) {
			breaking = 0;
			break;
		}
	}
	if (!returning)
		prog.pc = N1(savepc)->u.ip;
}

// Assembly:
pushq %rbx
movq 0xb85a(%rip), %rbx      # 0x102e8
movq (%rbx), %rax
movq (%rax), %rdi
callq 0x4a56
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x4aa5
jnp 0x4aee
movq 0x10(%rbx), %rdi
callq 0x2d79
cmpb $0x0, 0xb85b(%rip)      # 0x10310
jne 0x4b05
cmpb $0x1, 0xb85a(%rip)      # 0x10318
jne 0x4ac9
movb $0x0, 0xb851(%rip)      # 0x10318
jmp 0x4ad2
cmpb $0x1, 0xb844(%rip)      # 0x10314
je 0x4ae7
movq (%rbx), %rax
movq (%rax), %rdi
callq 0x4a56
ucomisd 0x458b(%rip), %xmm0     # 0x9070
jmp 0x4aa1
movb $0x0, 0xb826(%rip)      # 0x10314
cmpb $0x0, 0xb81b(%rip)      # 0x10310
jne 0x4b05
movq (%rbx), %rax
movq 0x10(%rax), %rax
movq %rax, 0xb7e3(%rip)      # 0x102e8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/code.c
// Function: forcode
void
forcode(void)
{
	Inst *savepc;

	savepc = prog.pc;
	for ((void)execpop(N4(savepc)); cond(savepc->u.ip); (void)execpop(N1(savepc)->u.ip)) {
		execute(N2(savepc)->u.ip);
		if (returning) {
			break;
		}
		if (continuing) {
			continuing = 0;
			continue;
		}
		if (breaking) {
			breaking = 0;
			break;
		}
	}
	if (!returning)
		prog.pc = N3(savepc)->u.ip;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq 0xb7d3(%rip), %r14      # 0x102e8
movq (%r14), %rax
movq (%rax), %rax
movq (%rax), %rax
movq (%rax), %rsi
movq %rsp, %rdi
callq 0x499e
movq 0x10(%r14), %rdi
callq 0x4a56
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x4b3e
jnp 0x4ba1
movq %rsp, %rbx
movq (%r14), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
callq 0x2d79
cmpb $0x0, 0xb7b9(%rip)      # 0x10310
jne 0x4bbe
cmpb $0x1, 0xb7b8(%rip)      # 0x10318
jne 0x4b6b
movb $0x0, 0xb7af(%rip)      # 0x10318
jmp 0x4b74
cmpb $0x1, 0xb7a2(%rip)      # 0x10314
je 0x4b9a
movq (%r14), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x499e
movq 0x10(%r14), %rdi
callq 0x4a56
ucomisd 0x44dc(%rip), %xmm0     # 0x9070
jne 0x4b41
jp 0x4b41
jmp 0x4ba1
movb $0x0, 0xb773(%rip)      # 0x10314
cmpb $0x0, 0xb768(%rip)      # 0x10310
jne 0x4bbe
movq (%r14), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq %rax, 0xb72a(%rip)      # 0x102e8
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/code.c
// Function: bltin
void
bltin(void)
{
	Datum d1, d2;
	Name *name;
	int narg, i;

	name = getnamearg();
	i = name->u.bltin;
	if (i == 0) {   /* sprintf */
		_sprintf();
		return;
	}
	narg = getintarg();
	if (narg == 0 && bltins[i].n == -1)
		narg = -1;
	if (narg != bltins[i].n)
		yyerror("%s: wrong arity", bltins[i].s);
	errno = 0;
	switch (narg) {
	case -1:
		d1.u.val = bltins[i].u.d;
		break;
	case 0:
		d1.u.val = (*bltins[i].u.f0)();
		break;
	case 1:
		d1 = popnum();
		d1.u.val = (*bltins[i].u.f1)(d1.u.val);
		break;
	case 2:
		d2 = popnum();
		d1 = popnum();
		d1.u.val = (*bltins[i].u.f2)(d1.u.val, d2.u.val);
		break;
	}
	d1.u.val = errcheck(d1.u.val, bltins[i].s);
	d1.isstr = 0;
	push(d1);
}

// Assembly:
movq 0xb70b(%rip), %rcx      # 0x102e8
movq (%rcx), %rax
movq 0x10(%rcx), %rcx
movq %rax, 0xb6fd(%rip)      # 0x102e8
movslq 0x18(%rcx), %rcx
testq %rcx, %rcx
je 0x415c
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl 0x10(%rax), %edx
movq (%rax), %rax
movq %rax, 0xb6d9(%rip)      # 0x102e8
leaq (%rcx,%rcx,2), %rax
leaq 0x8ce6(%rip), %rcx      # 0xd900
leaq (%rcx,%rax,8), %r15
movl 0x8(%r15), %eax
xorl %r14d, %r14d
cmpl $-0x1, %eax
sete %r14b
negl %r14d
testl %edx, %edx
cmovnel %edx, %r14d
cmpl %eax, %r14d
je 0x4c4b
movq (%r15), %rsi
leaq 0x458a(%rip), %rdi      # 0x91ce
xorl %eax, %eax
callq 0x27d2
callq 0x2050
movl $0x0, (%rax)
incl %r14d
cmpl $0x3, %r14d
ja 0x4d2b
movq %rax, %rbx
leaq 0x4473(%rip), %rax      # 0x90e0
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movsd 0x10(%r15), %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x4d2b
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x30af
movsd 0x8(%r14), %xmm0
movl 0x14(%r14), %ebp
callq *0x10(%r15)
jmp 0x4ce4
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x30af
movsd 0x8(%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x30af
movsd 0x8(%r14), %xmm0
movl 0x14(%r14), %ebp
movsd 0x8(%rsp), %xmm1
callq *0x10(%r15)
jmp 0x4ce4
callq *0x10(%r15)
movsd %xmm0, 0x8(%rsp)
movl (%rbx), %eax
movq (%r15), %r14
cmpl $0x21, %eax
jne 0x4d0d
movl $0x0, (%rbx)
leaq 0x478d(%rip), %rdi      # 0x948e
movq %r14, %rsi
xorl %eax, %eax
callq 0x27d2
movl (%rbx), %eax
cmpl $0x22, %eax
jne 0x4d2b
movl $0x0, (%rbx)
leaq 0x478a(%rip), %rdi      # 0x94a9
movq %r14, %rsi
xorl %eax, %eax
callq 0x27d2
jmp 0x4d2b
movl $0x18, %edi
callq 0x2230
movq %rax, %rbx
testq %rax, %rax
jne 0x4d4b
leaq 0x43c4(%rip), %rdi      # 0x9108
xorl %eax, %eax
callq 0x27d2
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rbx)
movl $0x0, 0x10(%rbx)
movl %ebp, 0x14(%rbx)
movq 0xb5c9(%rip), %rax      # 0x10330
movq %rax, (%rbx)
movq %rbx, 0xb5bf(%rip)      # 0x10330
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/code.c
// Function: verifydef
void
verifydef(Name *name, int type)
{
	if (name->type != UNDEF)
		yyerror("assigning %s to an already used name: %d",
		        (type == FUNCTION) ? "function" : "procedure",
		        name->type);
	name->type = type;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl 0x10(%rdi), %edx
cmpl $0x107, %edx            # imm = 0x107
je 0x4db6
cmpl $0x115, %ebx            # imm = 0x115
leaq 0x446a(%rip), %rax      # 0x9207
leaq 0x4483(%rip), %rsi      # 0x9227
cmoveq %rax, %rsi
leaq 0x442f(%rip), %rdi      # 0x91de
xorl %eax, %eax
callq 0x27d2
movl %ebx, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/code.c
// Function: define
void
define(Name *name, Name *params)
{
	Function *fun;
	int n;

	if (DEBUG)
		debug();
	fun = emalloc(sizeof *fun);
	fun->code = prog.base;          /* start of code */
	prog.base = prog.progp;         /* next code starts here */
	fun->params = params;
	for (n = 0; params; params = params->next)
		n++;
	fun->nparams = n;
	name->u.fun = fun;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movl $0x18, %edi
callq 0x2230
movq %rax, %r14
testq %rax, %rax
jne 0x4ded
leaq 0x4322(%rip), %rdi      # 0x9108
xorl %eax, %eax
callq 0x27d2
movq 0xb4ec(%rip), %rax      # 0x102e0
movq %rax, (%r14)
movq 0xb4da(%rip), %rax      # 0x102d8
movq %rax, 0xb4db(%rip)      # 0x102e0
movq %r15, 0x8(%r14)
xorl %eax, %eax
testq %r15, %r15
je 0x4e17
incl %eax
movq (%r15), %r15
jmp 0x4e0b
movl %eax, 0x10(%r14)
movq %r14, 0x18(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/code.c
// Function: call
void
call(void)
{
	Symbol *local;
	Frame *f;
	Datum d;
	Name *name, *tmp;
	int nargs;

	name = getnamearg();
	if (name->type != FUNCTION && name->type != PROCEDURE)
		yyerror("%s is not function nor procedure", name->s);
	nargs = getintarg();
	if (!frame.next->next) {
		f = emalloc(sizeof *f);
		f->next = NULL;
		frame.next->next = f;
	}
	frame.curr = f = frame.next;
	frame.tail = frame.next = frame.next->next;
	frame.next->prev = frame.curr;
	if (nargs > name->u.fun->nparams)
		yyerror("function %s called with wrong number of parameters", name->s);
	nargs = name->u.fun->nparams - nargs;
	local = NULL;
	for (tmp = name->u.fun->params; tmp; tmp = tmp->next) {
		if (nargs > 0) {
			d.u.val = 0.0;
			d.isstr = 0;
			nargs--;
		} else {
			d = pop();
		}
		local = installlocalsym(tmp->s, local);
		local->u = d.u;
		local->isstr = d.isstr;
	}
	f->name = name;
	f->retsymtab = currsymtab;
	currsymtab = f->local = local;
	f->retpc = prog.pc;
	execute(name->u.fun->code);
	returning = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0xb4ae(%rip), %rcx      # 0x102e8
movq (%rcx), %rax
movq 0x10(%rcx), %r14
movq %rax, 0xb4a0(%rip)      # 0x102e8
movl $0xfffffeeb, %ecx       # imm = 0xFFFFFEEB
addl 0x10(%r14), %ecx
cmpl $0x2, %ecx
jb 0x4e6f
movq 0x8(%r14), %rsi
leaq 0x43af(%rip), %rdi      # 0x9210
xorl %eax, %eax
callq 0x27d2
movq 0xb479(%rip), %rax      # 0x102e8
movl 0x10(%rax), %ebp
movq (%rax), %rax
movq %rax, 0xb46c(%rip)      # 0x102e8
movq 0xb485(%rip), %r15      # 0x10308
movq 0x8(%r15), %rbx
testq %rbx, %rbx
jne 0x4ebf
movl $0x30, %edi
callq 0x2230
movq %rax, %rbx
testq %rax, %rax
jne 0x4eb3
leaq 0x4263(%rip), %rdi      # 0x9108
xorl %eax, %eax
callq 0x27d2
movq 0xb455(%rip), %r15      # 0x10308
movq $0x0, 0x8(%rbx)
movq %rbx, 0x8(%r15)
movq %r15, 0xb43a(%rip)      # 0x10300
movq %rbx, 0xb43b(%rip)      # 0x10308
movq %rbx, 0xb424(%rip)      # 0x102f8
movq %r15, (%rbx)
movq 0x18(%r14), %rax
cmpl 0x10(%rax), %ebp
jle 0x4ef6
movq 0x8(%r14), %rsi
leaq 0x4346(%rip), %rdi      # 0x9231
xorl %eax, %eax
callq 0x27d2
movq 0x18(%r14), %rax
movq %r14, 0x8(%rsp)
movq 0x8(%rax), %r12
testq %r12, %r12
je 0x4f68
movl 0x10(%rax), %r13d
subl %ebp, %r13d
xorl %ebp, %ebp
leaq 0x10(%rsp), %rbx
testl %r13d, %r13d
jle 0x4f27
decl %r13d
xorps %xmm0, %xmm0
movsd %xmm0, (%rsp)
xorl %r14d, %r14d
jmp 0x4f3f
movq %rbx, %rdi
callq 0x2e4a
movsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rsp)
movl 0x20(%rsp), %r14d
movq 0x8(%r12), %rdi
callq 0x50e8
movq %rbp, (%rax)
movsd (%rsp), %xmm0
movsd %xmm0, 0x8(%rax)
movl %r14d, 0x18(%rax)
movq (%r12), %r12
movq %rax, %rbp
testq %r12, %r12
jne 0x4f12
jmp 0x4f6a
xorl %eax, %eax
movq 0x8(%rsp), %rdx
movq %rdx, 0x20(%r15)
movq 0xb3a6(%rip), %rcx      # 0x10320
movq %rcx, 0x18(%r15)
movq %rax, 0x10(%r15)
movq %rax, 0xb397(%rip)      # 0x10320
movq 0xb358(%rip), %rax      # 0x102e8
movq %rax, 0x28(%r15)
movq 0x18(%rdx), %rax
movq (%rax), %rdi
callq 0x2d79
movb $0x0, 0xb369(%rip)      # 0x10310
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/code.c
// Function: procret
static void
ret(void)
{
	currsymtab = frame.curr->retsymtab;
	prog.pc = frame.curr->retpc;
	frame.next = frame.curr;
	frame.curr = frame.curr->prev;
	returning = 1;
}

// Assembly:
pushq %rax
movq 0xb290(%rip), %rax      # 0x10300
movq 0x20(%rax), %rcx
cmpl $0x115, 0x10(%rcx)      # imm = 0x115
jne 0x5096
movq 0x8(%rcx), %rsi
leaq 0x41f4(%rip), %rdi      # 0x927c
xorl %eax, %eax
callq 0x27d2
movq 0xb26a(%rip), %rax      # 0x10300
movq 0x18(%rax), %rcx
movq %rcx, 0xb27f(%rip)      # 0x10320
movq 0x28(%rax), %rcx
movq %rcx, 0xb23c(%rip)      # 0x102e8
movq %rax, 0xb255(%rip)      # 0x10308
movq (%rax), %rax
movq %rax, 0xb243(%rip)      # 0x10300
movb $0x1, 0xb24c(%rip)      # 0x10310
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/code.c
// Function: eallocsym
static Symbol *
eallocsym(char *s)
{
	Symbol *sym;

	sym = emalloc(sizeof *sym);
	sym->name = s;
	sym->isstr = 0;
	sym->u.val = 0.0;
	return sym;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x20, %edi
callq 0x2230
movq %rax, %r14
testq %rax, %rax
jne 0x510f
leaq 0x4000(%rip), %rdi      # 0x9108
xorl %eax, %eax
callq 0x27d2
movq %rbx, 0x10(%r14)
movl $0x0, 0x18(%r14)
movq $0x0, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/lex.c
// Function: yy_create_buffer
YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
{
	YY_BUFFER_STATE b;
    
	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_buf_size = size;

	/* yy_ch_buf has to be 2 characters longer than the size given because
	 * we need to put in 2 end-of-buffer characters.
	 */
	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_is_our_buffer = 1;

	yy_init_buffer( b, file );

	return b;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movl $0x40, %edi
callq 0x2230
testq %rax, %rax
je 0x85cd
movq %rax, %r14
movl %ebp, 0x18(%rax)
addl $0x2, %ebp
movslq %ebp, %rdi
callq 0x2230
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x85cd
movl $0x1, 0x20(%r14)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8775
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1e6d(%rip), %rdi      # 0xa441
callq 0x874f
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/lex.c
// Function: yy_get_previous_state
static yy_state_type yy_get_previous_state (void)
{
	yy_state_type yy_current_state;
	char *yy_cp;
    
	yy_current_state = (yy_start);

	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
		{
		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
		if ( yy_accept[yy_current_state] )
			{
			(yy_last_accepting_state) = yy_current_state;
			(yy_last_accepting_cpos) = yy_cp;
			}
		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
			{
			yy_current_state = (int) yy_def[yy_current_state];
			if ( yy_current_state >= 56 )
				yy_c = yy_meta[yy_c];
			}
		yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
		}

	return yy_current_state;
}

// Assembly:
movzbl 0x7da8(%rip), %eax      # 0x10388
movq 0x7dd1(%rip), %rcx      # 0x103b8
movq 0x7db2(%rip), %rdx      # 0x103a0
cmpq %rdx, %rcx
jae 0x86b6
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movabsq $0xf980000a000007, %rsi # imm = 0xF980000A000007
leaq 0x1bae(%rip), %rdi      # 0xa1c0
leaq 0x1a77(%rip), %r8       # 0xa090
leaq 0x1cc0(%rip), %r9       # 0xa2e0
leaq 0x1c19(%rip), %r10      # 0xa240
movabsq $0x3990001a200300, %r11 # imm = 0x3990001A200300
leaq 0x1c88(%rip), %rbx      # 0xa2c0
movzbl (%rcx), %r15d
testq %r15, %r15
je 0x864e
leaq 0x18d8(%rip), %r14      # 0x9f20
movb (%r15,%r14), %bpl
jmp 0x8651
movb $0x1, %bpl
btq %rax, %rsi
jb 0x8664
movl %eax, 0x7d4f(%rip)      # 0x103ac
movq %rcx, 0x7d4c(%rip)      # 0x103b0
movslq %eax, %r15
movswq (%rdi,%r15,2), %r13
movzbl %bpl, %r12d
addq %r12, %r13
movswl (%r8,%r13,2), %r14d
cmpl %r14d, %eax
je 0x869f
btq %r15, %r11
jae 0x8687
movb (%r12,%rbx), %bpl
movswq (%r10,%r15,2), %r15
movswq (%rdi,%r15,2), %r13
movzbl %bpl, %r12d
addq %r12, %r13
cmpw (%r8,%r13,2), %r15w
jne 0x867d
movswl (%r9,%r13,2), %eax
incq %rcx
cmpq %rdx, %rcx
jne 0x8638
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/lex.c
// Function: yyrestart
void yyrestart  (FILE * input_file )
{
    
	if ( ! YY_CURRENT_BUFFER ){
        yyensure_buffer_stack ();
		YY_CURRENT_BUFFER_LVALUE =
            yy_create_buffer( yyin, YY_BUF_SIZE );
	}

	yy_init_buffer( YY_CURRENT_BUFFER, input_file );
	yy_load_buffer_state(  );
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x7cce(%rip), %rax      # 0x10390
testq %rax, %rax
je 0x86d7
movq 0x7cca(%rip), %rcx      # 0x10398
movq (%rax,%rcx,8), %rdi
testq %rdi, %rdi
jne 0x8702
callq 0x84e8
movq 0x7c8d(%rip), %rdi      # 0x10370
movl $0x4000, %esi           # imm = 0x4000
callq 0x8580
movq %rax, %rdi
movq 0x7c99(%rip), %rax      # 0x10390
movq 0x7c9a(%rip), %rcx      # 0x10398
movq %rdi, (%rax,%rcx,8)
movq %rbx, %rsi
callq 0x8775
movq 0x7c7f(%rip), %rax      # 0x10390
movq 0x7c80(%rip), %rcx      # 0x10398
movq (%rax,%rcx,8), %rdx
movl 0x1c(%rdx), %esi
movl %esi, 0x7c9f(%rip)      # 0x103c4
movq 0x10(%rdx), %rdx
movq %rdx, 0x7c70(%rip)      # 0x103a0
movq %rdx, 0x7c81(%rip)      # 0x103b8
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, 0x7c2b(%rip)      # 0x10370
movb (%rdx), %al
movb %al, 0x7c5b(%rip)       # 0x103a8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/lex.c
// Function: yy_scan_buffer
YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
{
	YY_BUFFER_STATE b;
    
	if ( size < 2 ||
	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
	     base[size-1] != YY_END_OF_BUFFER_CHAR )
		/* They forgot to leave room for the EOB's. */
		return NULL;

	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );

	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
	b->yy_buf_pos = b->yy_ch_buf = base;
	b->yy_is_our_buffer = 0;
	b->yy_input_file = NULL;
	b->yy_n_chars = b->yy_buf_size;
	b->yy_is_interactive = 0;
	b->yy_at_bol = 1;
	b->yy_fill_buffer = 0;
	b->yy_buffer_status = YY_BUFFER_NEW;

	yy_switch_to_buffer( b  );

	return b;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x2, %rsi
jb 0x8aba
movq %rsi, %r14
movq %rdi, %r15
cmpb $0x0, -0x2(%rdi,%rsi)
jne 0x8aba
cmpb $0x0, -0x1(%r15,%r14)
je 0x8ac5
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movl $0x40, %edi
callq 0x2230
testq %rax, %rax
je 0x8b13
movq %rax, %rbx
addq $-0x2, %r14
movl %r14d, 0x18(%rax)
movq %r15, 0x8(%rax)
movq %r15, 0x10(%rax)
movl $0x0, 0x20(%rax)
xorl %eax, %eax
movq %rax, (%rbx)
movl %r14d, 0x1c(%rbx)
movabsq $0x100000000, %rcx      # imm = 0x100000000
movq %rcx, 0x24(%rbx)
movq %rax, 0x34(%rbx)
movq %rbx, %rdi
callq 0x87f6
jmp 0x8abc
leaq 0x1953(%rip), %rdi      # 0xa46d
callq 0x874f
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/lex.c
// Function: yy_scan_bytes
YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len )
{
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n;
	int i;
    
	/* Get memory for full buffer, including space for trailing EOB's. */
	n = (yy_size_t) (_yybytes_len + 2);
	buf = (char *) yyalloc( n  );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );

	for ( i = 0; i < _yybytes_len; ++i )
		buf[i] = yybytes[i];

	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;

	b = yy_scan_buffer( buf, n );
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );

	/* It's okay to grow etc. this buffer, and we should throw it
	 * away when we're done.
	 */
	b->yy_is_our_buffer = 1;

	return b;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %r12
leal 0x2(%r14), %eax
movslq %eax, %rbx
movq %rbx, %rdi
callq 0x2230
testq %rax, %rax
je 0x8b98
movq %rax, %r15
testl %r14d, %r14d
jle 0x8b6b
movl %r14d, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x21f0
movslq %r14d, %rax
movw $0x0, (%r15,%rax)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8a9a
testq %rax, %rax
je 0x8ba4
movl $0x1, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x18f8(%rip), %rdi      # 0xa497
callq 0x874f
leaq 0x1915(%rip), %rdi      # 0xa4c0
callq 0x874f
// File: /workspace/github_c_makefile_star2_O3/phillbush[P]hoc/lex.c
// Function: yylex_destroy
int yylex_destroy  (void)
{
    
    /* Pop the buffer stack, destroying each element. */
	while(YY_CURRENT_BUFFER){
		yy_delete_buffer( YY_CURRENT_BUFFER  );
		YY_CURRENT_BUFFER_LVALUE = NULL;
		yypop_buffer_state();
	}

	/* Destroy the stack itself. */
	yyfree((yy_buffer_stack) );
	(yy_buffer_stack) = NULL;

    /* Reset the globals. This is important in a non-reentrant scanner so the next time
     * yylex() is called, initialization will occur. */
    yy_init_globals( );

    return 0;
}

// Assembly:
pushq %rax
movq 0x778d(%rip), %rdi      # 0x10390
testq %rdi, %rdi
je 0x8c3d
movq 0x7789(%rip), %rax      # 0x10398
movq (%rdi,%rax,8), %rax
testq %rax, %rax
je 0x8c3f
movq %rax, %rdi
callq 0x8895
movq 0x7769(%rip), %rax      # 0x10390
movq 0x776a(%rip), %rcx      # 0x10398
movq $0x0, (%rax,%rcx,8)
callq 0x8a06
jmp 0x8bfc
xorl %edi, %edi
callq 0x2030
movl $0x1, 0x5542(%rip)      # 0xe190
xorl %eax, %eax
movq %rax, 0x7739(%rip)      # 0x10390
movq %rax, 0x773a(%rip)      # 0x10398
movq %rax, 0x776b(%rip)      # 0x103d0
movq %rax, 0x7734(%rip)      # 0x103a0
movb %al, 0x7712(%rip)       # 0x10384
movb %al, 0x7710(%rip)       # 0x10388
movq %rax, 0x76f1(%rip)      # 0x10370
movq %rax, 0x76f2(%rip)      # 0x10378
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/u_kb11a.c
// Function: get_gsa
int
get_gsa(KB11A *kb)
{
	int set1 = !kb->cnsl_act && kb->c.ps&PS_GPR && kb->sf<6 ||
		kb->c.ps&PS_CM0 && kb->sf==6;
	int gsa;
	switch(kb->c.rbr.pad){
	case 0:
	case 1: gsa = kb->sf | (kb->c.ps&PS_CM1 && kb->sf==6); break;
	case 4: gsa = kb->sf | 1; break;
	case 2:
	case 3: gsa = 5; break;
	case 6: gsa = 0; break;
	case 5: gsa = kb->df | (!kb->cnsl_act && kb->df==6 &&
		kb->dm0_mfp_mtp_cond ? kb->c.ps&PS_PM1 : kb->c.ps&PS_CM1);
		break;
	case 7: gsa = kb->c.ps&PS_CM1 ? 7 : 6; break;
	}
	return gsa|set1<<3;
}

// Assembly:
movl 0x23c(%rdi), %esi
testl %esi, %esi
sete %al
movzwl 0x98(%rdi), %edx
movl %edx, %ecx
shrl $0xb, %ecx
andl $0x1, %ecx
andb %al, %cl
cmpb $0x1, %cl
jne 0x2496
movl $0x8, %ecx
cmpl $0x6, 0x220(%rdi)
jl 0x24ad
xorl %ecx, %ecx
btl $0xe, %edx
jae 0x24ad
xorl %ecx, %ecx
cmpl $0x6, 0x220(%rdi)
sete %cl
shll $0x3, %ecx
movl 0x48(%rdi), %r8d
movl $0x5, %eax
cmpq $0x7, %r8
ja 0x252e
leaq 0x1b61(%rip), %r9       # 0x4024
movslq (%r9,%r8,4), %r8
addq %r9, %r8
jmpq *%r8
movl 0x220(%rdi), %esi
testw %dx, %dx
sets %al
cmpl $0x6, %esi
sete %dl
andb %al, %dl
movzbl %dl, %eax
orl %esi, %eax
jmp 0x252e
movl 0x220(%rdi), %eax
orl $0x1, %eax
jmp 0x252e
xorl %eax, %eax
testw %dx, %dx
setns %al
xorl $0x7, %eax
jmp 0x252e
movl 0x224(%rdi), %eax
movl %eax, %r8d
xorl $0x6, %r8d
orl %r8d, %esi
jne 0x251f
movw $0x2000, %si            # imm = 0x2000
cmpl $0x0, 0x22c(%rdi)
jne 0x2523
movw $0x8000, %si            # imm = 0x8000
andl %esi, %edx
movzwl %dx, %edx
orl %edx, %eax
jmp 0x252e
xorl %eax, %eax
orl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/u_kb11a.c
// Function: get_gda
int
get_gda(KB11A *kb)
{
	int set1 = !kb->cnsl_act && kb->c.ps&PS_GPR && kb->df<6 ||
		kb->c.ps&PS_CM0 && kb->df==6 && !kb->dm0_mfp_mtp_cond;
	int gda;
	switch(kb->c.rbr.pad){
	case 0: gda = kb->sf | (kb->c.ps&PS_CM1 && kb->sf==6); break;
	case 4: gda = kb->sf | 1; break;
	case 1:
	case 5: gda = kb->df | (!kb->cnsl_act && kb->df==6 &&
		kb->dm0_mfp_mtp_cond ? kb->c.ps&PS_PM1 : kb->c.ps&PS_CM1);
		break;
	case 2: gda = 5; break;
	case 6: gda = 0; break;
	case 3:
	case 7: gda = kb->c.ps&PS_CM1 ? 7 : 6; break;
	}
	return gda|set1<<3;
}

// Assembly:
movl 0x23c(%rdi), %esi
testl %esi, %esi
sete %al
movzwl 0x98(%rdi), %edx
movl %edx, %ecx
shrl $0xb, %ecx
andl $0x1, %ecx
andb %al, %cl
cmpb $0x1, %cl
jne 0x2560
movl $0x8, %ecx
cmpl $0x6, 0x224(%rdi)
jl 0x2580
xorl %ecx, %ecx
btl $0xe, %edx
jae 0x2580
cmpl $0x6, 0x224(%rdi)
jne 0x2580
xorl %ecx, %ecx
cmpl $0x0, 0x22c(%rdi)
sete %cl
shll $0x3, %ecx
movl 0x48(%rdi), %r8d
movl $0x5, %eax
cmpq $0x7, %r8
ja 0x2601
leaq 0x1aae(%rip), %r9       # 0x4044
movslq (%r9,%r8,4), %r8
addq %r9, %r8
jmpq *%r8
movl 0x224(%rdi), %eax
movl %eax, %r8d
xorl $0x6, %r8d
orl %r8d, %esi
jne 0x25bf
movw $0x2000, %si            # imm = 0x2000
cmpl $0x0, 0x22c(%rdi)
jne 0x25c3
movw $0x8000, %si            # imm = 0x8000
andl %esi, %edx
movzwl %dx, %edx
orl %edx, %eax
jmp 0x2601
xorl %eax, %eax
testw %dx, %dx
setns %al
xorl $0x7, %eax
jmp 0x2601
movl 0x220(%rdi), %eax
orl $0x1, %eax
jmp 0x2601
xorl %eax, %eax
jmp 0x2601
movl 0x220(%rdi), %esi
testw %dx, %dx
sets %al
cmpl $0x6, %esi
sete %dl
andb %al, %dl
movzbl %dl, %eax
orl %esi, %eax
orl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/u_kb11a.c
// Function: load_sr
void
load_sr(KB11A *kb)
{
	if(kb->c.rbr.srk){
		// TODO: don't set here
		kb->sf = kb->c.ir>>6 & 7;
		int srsel = kb->c.rbr.srx == 1 || kb->c.rbr.srx&2 && kb->sf!=7;
		kb->n.sr = srsel ? kb->gs[get_gsa(kb)] : kb->shfr;
	}
}

// Assembly:
cmpl $0x0, 0x28(%rdi)
je 0x2658
pushq %rbx
movq %rdi, %rbx
movl 0xc(%rdi), %eax
movl 0x20(%rdi), %ecx
shrl $0x6, %eax
andl $0x7, %eax
movl %eax, 0x220(%rdi)
cmpl $0x1, %ecx
je 0x2630
testb $0x2, %cl
je 0x2646
cmpw $0x7, %ax
je 0x2646
movq %rbx, %rdi
callq 0x2467
cltq
leaq (%rbx,%rax,2), %rax
addq $0x140, %rax            # imm = 0x140
jmp 0x264d
leaq 0x216(%rbx), %rax
movzwl (%rax), %eax
movw %ax, 0xa6(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/u_kb11a.c
// Function: load_dr
void
load_dr(KB11A *kb)
{
	switch(kb->c.rbr.drk){
	case 0:	break;
	case 1: kb->n.dr = kb->c.dr>>1 | kb->alu<<15; break;
	case 2: kb->n.dr = kb->c.dr<<1; break;	// TODO
	case 3:
		if(kb->c.rbr.drx == 3)
			// TODO: this his held low until 5 even, do we need that?
			kb->n.dr = 0;
		else{
			// TODO: don't set here, wrong too
			kb->df = kb->c.ir & 7;
			int drsel = kb->c.rbr.drx == 1 || kb->c.rbr.drx&2 && kb->df!=7;
			kb->n.dr = drsel ? kb->gd[get_gda(kb)] : kb->shfr;
		}
		break;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x2c(%rdi), %eax
cmpl $0x3, %eax
je 0x2688
cmpl $0x2, %eax
je 0x2681
cmpl $0x1, %eax
jne 0x26d8
movzwl 0x8(%rbx), %ecx
movzwl 0x21c(%rbx), %eax
shldw $0xf, %cx, %ax
jmp 0x26d1
movl 0x8(%rbx), %eax
addl %eax, %eax
jmp 0x26d1
movl 0x24(%rbx), %ecx
cmpl $0x3, %ecx
jne 0x2694
xorl %eax, %eax
jmp 0x26d1
movzwl 0xc(%rbx), %eax
andl $0x7, %eax
movl %eax, 0x224(%rbx)
cmpl $0x1, %ecx
je 0x26b1
testb $0x2, %cl
je 0x26c7
cmpw $0x7, %ax
je 0x26c7
movq %rbx, %rdi
callq 0x2531
cltq
leaq (%rbx,%rax,2), %rax
addq $0x160, %rax            # imm = 0x160
jmp 0x26ce
leaq 0x216(%rbx), %rax
movzwl (%rax), %eax
movw %ax, 0xa8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/u_kb11a.c
// Function: update_radr
void
update_radr(KB11A *kb)
{
	byte af = kb->c.rbr.fen & 1 ? get_afork(kb) : M8;
	byte bf = kb->c.rbr.fen & 2 ? get_bfork(kb) : M8;
	byte cf = kb->c.rbr.fen & 4 ? get_cfork(kb) : M8;
	kb->radr = (kb->rom.adr | get_brcab(kb)) & cf & bf & af;
	printf("getting new address %o\n", kb->radr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x78(%rdi), %ebp
xorl %r14d, %r14d
testb $0x1, %bpl
movl $0xff, %r15d
movl $0x0, %r12d
cmovel %r15d, %r12d
movl 0x1f0(%rdi), %r13d
testb $0x4, %bpl
cmovnel %r14d, %r15d
callq 0x2ae2
movzbl %al, %esi
orl %r13d, %esi
andl %r15d, %esi
testb $0x2, %bpl
cmovnel %r14d, %esi
andl %r12d, %esi
movw %si, 0x180(%rbx)
leaq 0x1c08(%rip), %rdi      # 0x492e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/u_kb11a.c
// Function: t1
void
t1(KB11A *kb)
{
	printf("T1\n");

	kb->n.rbr.bsd = kb->rom.bsd;
	kb->n.rbr.bax = kb->rom.bax;
	kb->n.rbr.ibs = kb->rom.ibs;
	kb->n.rbr.shc = kb->rom.shc;
	kb->n.rbr.bct = kb->rom.bct;
	kb->n.rbr.msc = kb->rom.msc;
	kb->n.rbr.bsc = kb->rom.bsc;
	kb->n.rbr.amx = kb->rom.amx;
	kb->n.rbr.bmx = kb->rom.bmx;
	kb->n.rbr.kmx = kb->rom.kmx;
	kb->n.rbr.alu = kb->rom.alu;

	load_sr(kb);
	load_dr(kb);
	if(kb->c.rbr.drk == 3)
		/* not quite correct, but should be ok */
		kb->grab_obd = kb->n.dr & 1;
	if(kb->c.rbr.brk)
printf("load BR %o %o\n", kb->c.rbr.brx<<2 | kb->sel_int<<1 | kb->sel_mem, kb->brmx);
		kb->n.br = kb->brmx;

	/* falling edge */
	kb->n.rbr.pwe = kb->rom.pwe;
	kb->n.rbr.pad = kb->rom.pad;

	kb->c = kb->n;
	update_state(kb);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x1c0f(%rip), %rdi      # 0x4955
callq 0x2030
movups 0x1bc(%rbx), %xmm0
movups 0x1cc(%rbx), %xmm1
movups %xmm0, 0xec(%rbx)
movups %xmm1, 0xfc(%rbx)
movq 0x1dc(%rbx), %rax
movq %rax, 0x10c(%rbx)
movl 0x1e4(%rbx), %eax
movl %eax, 0x114(%rbx)
movq %rbx, %rdi
callq 0x2604
movq %rbx, %rdi
callq 0x2659
cmpl $0x3, 0x2c(%rbx)
jne 0x2da7
movzwl 0xa8(%rbx), %eax
andl $0x1, %eax
movl %eax, 0x230(%rbx)
cmpl $0x0, 0x18(%rbx)
je 0x2dd8
movl 0x1c(%rbx), %eax
shll $0x2, %eax
movl 0x240(%rbx), %esi
addl %esi, %esi
orl %eax, %esi
orl 0x244(%rbx), %esi
movzwl 0x218(%rbx), %edx
leaq 0x1b75(%rip), %rdi      # 0x4946
xorl %eax, %eax
callq 0x2040
leaq 0xa0(%rbx), %rsi
movzwl 0x218(%rbx), %eax
movw %ax, 0xa0(%rbx)
movq 0x1b4(%rbx), %rax
movq %rax, 0xe4(%rbx)
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x2080
movq %rbx, %rdi
popq %rbx
jmp 0x26da
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/u_kb11a.c
// Function: t2
void
t2(KB11A *kb)
{
	printf("T2\n");

	kb->n.rbr.brk = kb->rom.brk;
	kb->n.rbr.brx = kb->rom.brx;
	kb->n.rbr.srx = kb->rom.srx;
	kb->n.rbr.drx = kb->rom.drx;
	kb->n.rbr.srk = kb->rom.srk;
	kb->n.rbr.drk = kb->rom.drk;
	kb->n.rbr.ccl = kb->rom.ccl;
	kb->n.rbr.pca = kb->rom.pca;
	kb->n.rbr.pcb = kb->rom.pcb;
	kb->n.rbr.shf = kb->rom.shf;
	kb->n.rbr.irk = kb->rom.irk;

	kb->c = kb->n;
	update_state(kb);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x1b3c(%rip), %rdi      # 0x4958
callq 0x2030
leaq 0xa0(%rbx), %rsi
movups 0x188(%rbx), %xmm0
movups 0x198(%rbx), %xmm1
movups %xmm0, 0xb8(%rbx)
movups %xmm1, 0xc8(%rbx)
movq 0x1a8(%rbx), %rax
movq %rax, 0xd8(%rbx)
movl 0x1b0(%rbx), %eax
movl %eax, 0xe0(%rbx)
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x2080
movq %rbx, %rdi
popq %rbx
jmp 0x26da
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/u_kb11a.c
// Function: t3
void
t3(KB11A *kb)
{
	printf("T3\n");

	update_radr(kb);
	kb->n.rar = kb->radr;
	if(kb->c.rbr.bct == 7){	// TODO: or
		// TODO: BEND, see UBCB CLR UNI
		printf("	BEND (TODO)\n");
	}
	if(kb->c.rbr.msc == 6){
		// TODO: BRQ strobe, TMCE
		printf("	BRQ STROBE (TODO)\n");
		// CLK CONF
		// if(ubcf_s_inst) tmca_conf = 1;
		// BRQ CLK
	}

	kb->c = kb->n;
	update_state(kb);
	update_rom(kb);
}

// Assembly:
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
leaq 0x1ad5(%rip), %rdi      # 0x495b
callq 0x2030
movq %rbx, %rdi
callq 0x2cc8
movb 0x180(%rbx), %al
movb %al, 0xb6(%rbx)
cmpl $0x7, 0x5c(%rbx)
jne 0x2eb1
leaq 0x1ab2(%rip), %rdi      # 0x495e
callq 0x2030
cmpl $0x6, 0x60(%rbx)
jne 0x2ec3
leaq 0x1aad(%rip), %rdi      # 0x496b
callq 0x2030
leaq 0xa0(%rbx), %rsi
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x26da
movzbl 0x16(%rbx), %ecx
addq $0x188, %rbx            # imm = 0x188
shll $0x7, %ecx
leaq 0x41cc(%rip), %rax      # 0x70c0
addq %rcx, %rax
movl $0x10, %ecx
movq %rbx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0x10, %ecx
movq %rsp, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x218c
addq $0x80, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/u_kb11a.c
// Function: test
void
test(KB11A *kb)
{
	kb->n.pcb = 01234;
	kb->n.dr = 04321;
	kb->sw = 0112233;
	kb->unibusd = 0123321;

	int i;
	for(i = 0; i < 3; i++){
		t1(kb);
		dumpstate(kb);
		t2(kb);
		dumpstate(kb);
		if(kb->c.rbr.bsd == INTR_PAUSE)
			printf("	INTR PAUSE\n");
		t3(kb);
		dumpstate(kb);
		t4(kb);
		dumpstate(kb);
		t5(kb);
		dumpstate(kb);
		printf("----------\n");
	}
	t1(kb);
	dumpstate(kb);

/*
	kb->c.ir = 0012701;
	kb->c.ir = 0066700;
	ir_decode(kb);
	update_state(kb);
*/
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movw $0x29c, 0xa4(%rdi)      # imm = 0x29C
movw $0x8d1, 0xa8(%rdi)      # imm = 0x8D1
movl $0x949b, 0x254(%rdi)    # imm = 0x949B
movw $0xa6d1, 0x24c(%rdi)    # imm = 0xA6D1
leaq 0xa0(%rdi), %r14
movl $0x3, %r15d
leaq 0x18fb(%rip), %r12      # 0x497e
leaq 0x18f7(%rip), %r13      # 0x4981
leaq 0x18ff(%rip), %rbp      # 0x4990
movq %rbx, %rdi
callq 0x2d3b
movq %rbx, %rdi
callq 0x2329
movq %rbx, %rdi
callq 0x2e11
movq %rbx, %rdi
callq 0x2329
cmpl $0x1, 0x4c(%rbx)
jne 0x30c3
leaq 0x18c6(%rip), %rdi      # 0x4984
callq 0x2030
movq %rbx, %rdi
callq 0x2e74
movq %rbx, %rdi
callq 0x2329
movq %r12, %rdi
callq 0x2030
movl $0xa0, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2080
movq %rbx, %rdi
callq 0x26da
movq %rbx, %rdi
callq 0x2329
movq %r13, %rdi
callq 0x2030
movl $0xa0, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2080
movq %rbx, %rdi
callq 0x26da
movq %rbx, %rdi
callq 0x2329
movq %rbp, %rdi
callq 0x2030
decl %r15d
jne 0x3091
movq %rbx, %rdi
callq 0x2d3b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2329
// File: /workspace/github_c_makefile_star2_O3/aap[P]pdp11/u_kb11a.c
// Function: main
int
main()
{
	KB11A *kb;
	kb = malloc(sizeof(KB11A));

	power(kb);
	test(kb);

	return 0;
}

// Assembly:
pushq %rbx
subq $0x80, %rsp
movl $0x1, %edi
movl $0x258, %esi            # imm = 0x258
callq 0x2070
movq %rax, %rbx
movl $0x1, 0x234(%rax)
leaq 0xa0(%rax), %rsi
movb $-0x80, 0xb6(%rax)
movl $0xa0, %edx
movq %rax, %rdi
callq 0x2080
leaq 0x188(%rbx), %rdi
movzbl 0x16(%rbx), %ecx
shll $0x7, %ecx
leaq 0x3f1a(%rip), %rax      # 0x70c0
addq %rcx, %rax
movl $0x10, %ecx
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl $0x10, %ecx
movq %rsp, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x218c
movq %rbx, %rdi
callq 0x303c
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/CSerxzm[P]WindowstoLinuxInterface/src/TYPE.c
// Function: main
int main(int argc, char** argv){
    char lines[argc+1][255];
    predealLine(argc, argv, lines);
    struct stat dir_stat;
    if(access(lines[1], F_OK)==0){
        if(stat(lines[1], &dir_stat)>=0){
            if(S_ISREG(dir_stat.st_mode)){
                FILE *fp=fopen(lines[1],"r");
                copy_file(fp,stdout);
            }
            else{
                perror("Not reg\n");
            }
        }
        else{
            perror("stat error!\n");
        }
    }
    else{
        perror("Don't exist\n");
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
leal 0x1(%rdi), %eax
movq %rax, %rcx
shlq $0x8, %rcx
subq %rax, %rcx
addq $0xf, %rcx
movabsq $0x1fffffffff0, %rbx    # imm = 0x1FFFFFFFFF0
andq %rcx, %rbx
movq %rsp, %r14
movq %r14, %rdx
subq %rbx, %rdx
movq %rdx, %rsp
callq 0x11bc
negq %rbx
addq %r14, %rbx
addq $0xff, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1060
testl %eax, %eax
jne 0x1391
leaq -0xa0(%rbp), %rsi
movq %rbx, %rdi
callq 0x1050
testl %eax, %eax
js 0x139a
movl $0xf000, %eax           # imm = 0xF000
andl -0x88(%rbp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x13a3
leaq 0xc98(%rip), %rsi       # 0x2004
movq %rbx, %rdi
callq 0x1070
movq 0x2c65(%rip), %rcx      # 0x3fe0
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x12bd
xorl %eax, %eax
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xc84(%rip), %rdi       # 0x201c
jmp 0x13aa
leaq 0xc6e(%rip), %rdi       # 0x200f
jmp 0x13aa
leaq 0xc5c(%rip), %rdi       # 0x2006
callq 0x1080
jmp 0x1386
// File: /workspace/github_c_makefile_star2_O3/sfeakes[P]unifi-motion/config.c
// Function: print_config
void print_config(umConfig *config)
{
  int i;

  fprintf(stderr, "CFG mqtt address '%s'\n", config->mqtt_address );
  fprintf(stderr, "CFG mqtt user '%s'\n", config->mqtt_user );
  fprintf(stderr, "CFG mqtt passwd '%s'\n", config->mqtt_passwd );
  fprintf(stderr, "CFG mqtt topic '%s'\n", config->mqtt_pub_topic );
  fprintf(stderr, "CFG log regexp '%s'\n", config->regexString );
  fprintf(stderr, "CFG log to monitor '%s'\n", config->log_file_to_monitor );
  fprintf(stderr, "CFG watch filename '%s'\n", config->watchFile );
  fprintf(stderr, "CFG watch directory '%s'\n", config->watchDir );

  for (i = 0; i < config->numMotions; i++) {
    fprintf(stderr, "CFG Motion '%s'='%s'\n", config->motions[i]->name, config->motions[i]->action);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1a6bc(%rip), %r15     # 0x1dff0
movq (%r15), %rdi
movq (%rbx), %rdx
leaq 0x1418b(%rip), %rsi     # 0x17acc
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x8(%rbx), %rdx
leaq 0x1418d(%rip), %rsi     # 0x17ae3
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x10(%rbx), %rdx
leaq 0x1418c(%rip), %rsi     # 0x17af7
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x18(%rbx), %rdx
leaq 0x1418d(%rip), %rsi     # 0x17b0d
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x28(%rbx), %rdx
leaq 0x1418d(%rip), %rsi     # 0x17b22
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x20(%rbx), %rdx
leaq 0x1418d(%rip), %rsi     # 0x17b37
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x50(%rbx), %rdx
leaq 0x14191(%rip), %rsi     # 0x17b50
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x48(%rbx), %rdx
leaq 0x14195(%rip), %rsi     # 0x17b69
xorl %eax, %eax
callq 0x3340
cmpl $0x0, 0x1d8(%rbx)
jle 0x3a16
leaq 0x14198(%rip), %r14     # 0x17b83
xorl %r12d, %r12d
movq (%r15), %rdi
movq 0x98(%rbx,%r12,8), %rdx
leaq 0x28(%rdx), %rcx
movq %r14, %rsi
xorl %eax, %eax
callq 0x3340
incq %r12
movslq 0x1d8(%rbx), %rax
cmpq %rax, %r12
jl 0x39ee
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/sfeakes[P]unifi-motion/unifi-motion.c
// Function: mac
bool mac(char *buf, int len)
{
  struct ifreq s;
  int fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
  struct if_nameindex *if_nidxs, *intf;

  if_nidxs = if_nameindex();
  if (if_nidxs != NULL)
  {
    for (intf = if_nidxs; intf->if_index != 0 || intf->if_name != NULL; intf++)
    {
      strcpy(s.ifr_name, intf->if_name);
      if (0 == ioctl(fd, SIOCGIFHWADDR, &s))
      {
        int i;
        if ( s.ifr_addr.sa_data[0] == 0 &&
             s.ifr_addr.sa_data[1] == 0 &&
             s.ifr_addr.sa_data[2] == 0 &&
             s.ifr_addr.sa_data[3] == 0 &&
             s.ifr_addr.sa_data[4] == 0 &&
             s.ifr_addr.sa_data[5] == 0 ) {
          continue;
        }
        for (i = 0; i < 6 && i * 2 < len; ++i)
        {
          sprintf(&buf[i * 2], "%02x", (unsigned char)s.ifr_addr.sa_data[i]);
        }
        return true;
      }
    }
  }

  return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
movq %rdi, %rbx
xorl %r12d, %r12d
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x3670
movl %eax, %r14d
callq 0x3430
testq %rax, %rax
je 0x3bf3
movq %rax, %r15
cmpl $0x0, (%rax)
sete %al
movq 0x8(%r15), %rsi
testq %rsi, %rsi
sete %cl
testb %cl, %al
jne 0x3bf0
movslq %ebp, %r13
addq $0x18, %r15
movq %rsp, %r12
movq %r12, %rdi
callq 0x30e0
movl $0x8927, %esi           # imm = 0x8927
movl %r14d, %edi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3250
testl %eax, %eax
jne 0x3bd4
cmpl $0x0, 0x12(%rsp)
jne 0x3c05
cmpb $0x0, 0x16(%rsp)
jne 0x3c05
cmpb $0x0, 0x17(%rsp)
jne 0x3c05
cmpl $0x0, -0x8(%r15)
sete %al
movq (%r15), %rsi
testq %rsi, %rsi
sete %cl
andb %al, %cl
addq $0x10, %r15
cmpb $0x1, %cl
jne 0x3ba1
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %r12b
testl %ebp, %ebp
jle 0x3bf3
movl $0x2, %r15d
leaq 0x13a0a(%rip), %r14     # 0x17623
xorl %ebp, %ebp
leaq (%rbx,%r15), %rdi
addq $-0x2, %rdi
movzbl 0x12(%rsp,%rbp), %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x35a0
cmpq $0x4, %rbp
ja 0x3bf3
incq %rbp
leaq 0x2(%r15), %rax
cmpq %r13, %r15
movq %rax, %r15
jl 0x3c1b
jmp 0x3bf3
// File: /workspace/github_c_makefile_star2_O3/sfeakes[P]unifi-motion/unifi-motion.c
// Function: generate_mqtt_id
char *generate_mqtt_id(char *buf, int len) {
  extern char *__progname; // glibc populates this
  int i;
  strncpy(buf, basename(__progname), len);
  i = strlen(buf);

  if (i < len) {
    buf[i++] = '_';
    // If we can't get MAC to pad mqtt id then use PID
    if (!mac(&buf[i], len - i)) {
      sprintf(&buf[i], "%.*d", (len-i), getpid());
    }
  }
  buf[len] = '\0';

  return buf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x1a35b(%rip), %rax     # 0x1dfb8
movq (%rax), %rdi
callq 0x33b0
movslq %ebp, %r14
movq %rbx, %rdi
movq %rax, %rsi
movq %r14, %rdx
callq 0x30b0
movq %rbx, %rdi
callq 0x3180
movq %rax, %r15
cmpl %r14d, %r15d
jge 0x3cc7
movslq %r15d, %rax
movb $0x5f, (%rbx,%rax)
movslq %r15d, %rax
leaq (%rax,%rbx), %r12
incq %r12
notl %r15d
addl %ebp, %r15d
movq %r12, %rdi
movl %r15d, %esi
callq 0x3b4c
testb %al, %al
jne 0x3cc7
callq 0x3130
leaq 0x1134c(%rip), %rsi     # 0x15004
movq %r12, %rdi
movl %r15d, %edx
movl %eax, %ecx
xorl %eax, %eax
callq 0x35a0
movb $0x0, (%rbx,%r14)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sfeakes[P]unifi-motion/unifi-motion.c
// Function: send_mqtt_msg
void send_mqtt_msg(struct mg_connection *nc, char *message) {
  static uint16_t msg_id = 0;

  if ( _mqtt_status == mqttstopped || _mqtt_connection == NULL) {
  //if ( _mqtt_exit_flag == true || _mqtt_connection == NULL) {
    fprintf(stderr, "ERROR: No mqtt connection, can't send message '%s'\n", message);
    return;
  }
  // basic counter to give each message a unique ID.
  if (msg_id >= 65535) {
    msg_id = 1;
  } else {
    msg_id++;
  }

  mg_mqtt_publish(nc, _config.mqtt_pub_topic, msg_id, MG_MQTT_QOS(0), message, strlen(message));

  LOG("MQTT: Published: '%s' with id %d\n", message, msg_id);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x2, 0x1a667(%rip)     # 0x1e350
je 0x3d40
cmpq $0x0, 0x1a6b5(%rip)     # 0x1e3a8
je 0x3d40
movq %rdi, %r14
movzwl 0x1a6a1(%rip), %eax     # 0x1e3a0
incw %ax
movl $0x1, %ebp
cmovnel %eax, %ebp
movw %bp, 0x1a68f(%rip)      # 0x1e3a0
movq 0x1a6b0(%rip), %r15     # 0x1e3c8
movq %rbx, %rdi
callq 0x3180
movzwl %bp, %edx
movq %r14, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
movq %rbx, %r8
movq %rax, %r9
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x11b74
movq 0x1a2a9(%rip), %rax     # 0x1dff0
movq (%rax), %rdi
leaq 0x112b8(%rip), %rsi     # 0x15009
movq %rbx, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3340
// File: /workspace/github_c_makefile_star2_O3/sfeakes[P]unifi-motion/unifi-motion.c
// Function: start_mqtt
void start_mqtt (struct mg_mgr *mgr) {
  LOG("Starting MQTT service\n");

  if (mg_connect(mgr, _config.mqtt_address, ev_handler) == NULL) {
    fprintf(stderr, "mg_connect(%s) failed\n", _config.mqtt_address);
    exit(EXIT_FAILURE);
  }
  _mqtt_status = mqttstarting;
}

// Assembly:
pushq %rax
movq 0x1a643(%rip), %rsi     # 0x1e3b0
leaq 0x1b(%rip), %rdx        # 0x3d8f
callq 0x88c8
testq %rax, %rax
je 0x3d8a
movl $0x0, 0x1a5c8(%rip)     # 0x1e350
popq %rax
retq
callq 0x3728
// File: /workspace/github_c_makefile_star2_O3/sfeakes[P]unifi-motion/unifi-motion.c
// Function: open_log
FILE *open_log(bool seekBackOneLine)
{
  FILE *fp = NULL;
  int i=0;

  // Try to open log file a number of times, with pause inbetween.  Do this for logroatate
  // as the file may get moved and not re-created for a small period of time.
  while (fp == NULL)
  {
    if ( NULL != (fp = fopen(_config.log_file_to_monitor, "r")))
      break;
    
    i++;
    fprintf(stderr, "Open log file '%s' error\n%s\n", _config.log_file_to_monitor, strerror(errno));
    
    if (i > LOGFILE_OPEN_TRIES) {
      fprintf(stderr, "ERROR: Can't open logfile '%s', giving up\n", _config.log_file_to_monitor);
      cleanup();
      exit(EXIT_FAILURE);
    }
    sleep(1);
  }

  if (seekBackOneLine == false)
  {
    if (fseek(fp, 0L, SEEK_END) != 0)
    {
      fprintf(stderr, "Seek to end of file log error\n%s\n", strerror(errno));
    }
  }
  else
  {
    char c;
    fseek(fp, -1, SEEK_END); //next to last char, last is EOF
    c = fgetc(fp);
    
    while (c == '\n') //define macro EOL
    {
      if (fseek(fp, -2, SEEK_CUR) != 0){break;}
      c = fgetc(fp);
    }
    while (c != '\n')
    {
      if (fseek(fp, -2, SEEK_CUR) != 0){break;}
      c = fgetc(fp);
    }
    if (c == '\n')
      fseek(fp, 1, SEEK_CUR);
  }

  _umHandles.logfile = fp;
  return fp;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
movq 0x1a5dd(%rip), %rdi     # 0x1e3d0
leaq 0x13343(%rip), %rsi     # 0x1713d
callq 0x3520
movq %rax, %rbx
testq %rax, %rax
je 0x3ea3
movq %rbx, %rdi
testb %bpl, %bpl
je 0x3e82
movq $-0x1, %rsi
movl $0x2, %edx
callq 0x3480
movq %rbx, %rdi
callq 0x3270
cmpb $0xa, %al
jne 0x3e68
movq %rbx, %rdi
movq $-0x2, %rsi
movl $0x1, %edx
callq 0x3480
testl %eax, %eax
je 0x3e24
movl $0x1, %esi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x3480
jmp 0x3e92
movq %rbx, %rdi
callq 0x3270
cmpb $0xa, %al
je 0x3e48
movq %rbx, %rdi
movq $-0x2, %rsi
movl $0x1, %edx
callq 0x3480
testl %eax, %eax
je 0x3e5c
jmp 0x3e92
xorl %esi, %esi
movl $0x2, %edx
callq 0x3480
testl %eax, %eax
jne 0x3eb6
movq %rbx, 0x1a6f7(%rip)     # 0x1e590
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x3823
movq (%rbx), %rbx
jmp 0x3e0b
callq 0x38d1
jmp 0x3e92
// File: /workspace/github_c_makefile_star2_O3/sfeakes[P]unifi-motion/unifi-motion.c
// Function: cleanup
void cleanup() {
  close_log(_umHandles.logfile);
  inotify_rm_watch(_umHandles.trigger, _umHandles.descriptor);

  if (_mqtt_status == mqttrunning && _mqtt_connection != NULL)
    mg_mqtt_disconnect(_mqtt_connection);

  free_config(&_config);
}

// Assembly:
pushq %rax
movq 0x1a6cb(%rip), %rdi     # 0x1e590
testq %rdi, %rdi
je 0x3ecf
callq 0x3160
movl 0x1a6c3(%rip), %edi     # 0x1e598
movl 0x1a6c5(%rip), %esi     # 0x1e5a0
callq 0x3610
cmpl $0x1, 0x1a469(%rip)     # 0x1e350
sete %al
movq 0x1a4b7(%rip), %rdi     # 0x1e3a8
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3f03
callq 0x12199
leaq 0x1a4a6(%rip), %rdi     # 0x1e3b0
popq %rax
jmp 0x14c01