LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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 0xb642(%rip), %rcx      # 0x102e8
movq (%rcx), %rax
movq 0x10(%rcx), %rcx
movq %rax, 0xb634(%rip)      # 0x102e8
movslq 0x18(%rcx), %rcx
testq %rcx, %rcx
je 0x41db
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl 0x10(%rax), %r14d
movq (%rax), %rax
movq %rax, 0xb60d(%rip)      # 0x102e8
leaq (%rcx,%rcx,2), %rax
leaq 0x8c1a(%rip), %rcx      # 0xd900
testl %r14d, %r14d
jne 0x4cfa
xorl %r14d, %r14d
cmpl $-0x1, 0x8(%rcx,%rax,8)
sete %r14b
negl %r14d
leaq (%rcx,%rax,8), %r15
cmpl 0x8(%r15), %r14d
je 0x4d15
movq (%r15), %rsi
leaq 0x44c0(%rip), %rdi      # 0x91ce
xorl %eax, %eax
callq 0x27e6
callq 0x2050
movq %rax, %rbx
movl $0x0, (%rax)
incl %r14d
cmpl $0x3, %r14d
ja 0x4db5
leaq 0x43a9(%rip), %rax      # 0x90e0
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movsd 0x10(%r15), %xmm0
jmp 0x4dae
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x30b3
movq (%r14), %r12
movsd 0x8(%r14), %xmm0
movl 0x14(%r14), %ebp
callq *0x10(%r15)
jmp 0x4da3
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x30b3
movsd 0x8(%r14), %xmm0
movsd %xmm0, (%rsp)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x30b3
movq (%r14), %r12
movsd 0x8(%r14), %xmm0
movl 0x14(%r14), %ebp
movsd (%rsp), %xmm1
callq *0x10(%r15)
movsd %xmm0, (%rsp)
jmp 0x4db5
callq *0x10(%r15)
movsd %xmm0, (%rsp)
jmp 0x4db5
movq (%r15), %r14
cmpl $0x21, (%rbx)
jne 0x4dd4
movl $0x0, (%rbx)
leaq 0x46c4(%rip), %rdi      # 0x948e
movq %r14, %rsi
xorl %eax, %eax
callq 0x27e6
cmpl $0x22, (%rbx)
jne 0x4df0
movl $0x0, (%rbx)
leaq 0x46c3(%rip), %rdi      # 0x94a9
movq %r14, %rsi
xorl %eax, %eax
callq 0x27e6
movl $0x18, %edi
callq 0x2230
movq %rax, %rbx
testq %rax, %rax
jne 0x4e10
leaq 0x42ff(%rip), %rdi      # 0x9108
xorl %eax, %eax
callq 0x27e6
movq %r12, (%rbx)
movsd (%rsp), %xmm0
movsd %xmm0, 0x8(%rbx)
movl $0x0, 0x10(%rbx)
movl %ebp, 0x14(%rbx)
movq 0xb502(%rip), %rax      # 0x10330
movq %rax, (%rbx)
movq %rbx, 0xb4f8(%rip)      # 0x10330
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4e7f
cmpl $0x115, %ebx            # imm = 0x115
leaq 0x43a1(%rip), %rax      # 0x9207
leaq 0x43ba(%rip), %rsi      # 0x9227
cmoveq %rax, %rsi
leaq 0x4366(%rip), %rdi      # 0x91de
xorl %eax, %eax
callq 0x27e6
movl %ebx, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4eb6
leaq 0x4259(%rip), %rdi      # 0x9108
xorl %eax, %eax
callq 0x27e6
movq 0xb423(%rip), %rax      # 0x102e0
movq %rax, (%r14)
movq 0xb411(%rip), %rax      # 0x102d8
movq %rax, 0xb412(%rip)      # 0x102e0
movq %r15, 0x8(%r14)
xorl %eax, %eax
testq %r15, %r15
je 0x4ee0
incl %eax
movq (%r15), %r15
jmp 0x4ed4
movl %eax, 0x10(%r14)
movq %r14, 0x18(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xb1be(%rip), %rax      # 0x10300
movq 0x20(%rax), %rax
cmpl $0x115, 0x10(%rax)      # imm = 0x115
jne 0x5161
movq 0x8(%rax), %rsi
leaq 0x4122(%rip), %rdi      # 0x927c
xorl %eax, %eax
callq 0x27e6
movq 0xb198(%rip), %rax      # 0x10300
movq 0x18(%rax), %rcx
movq %rcx, 0xb1ad(%rip)      # 0x10320
movq 0x28(%rax), %rcx
movq %rcx, 0xb16a(%rip)      # 0x102e8
movq %rax, 0xb183(%rip)      # 0x10308
movq (%rax), %rax
movq %rax, 0xb171(%rip)      # 0x10300
movb $0x1, 0xb17a(%rip)      # 0x10310
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x51e1
leaq 0x3f2e(%rip), %rdi      # 0x9108
xorl %eax, %eax
callq 0x27e6
movq %rbx, 0x10(%r14)
movl $0x0, 0x18(%r14)
movq $0x0, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x7cc7
movq %rax, %r14
movl %ebp, 0x18(%rax)
addl $0x2, %ebp
movslq %ebp, %rdi
callq 0x2230
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x7cc7
movl $0x1, 0x20(%r14)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x7e85
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2773(%rip), %rdi      # 0xa441
callq 0x7e5f
// File: /workspace/github_c_makefile_star2_O1/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 0x86ae(%rip), %eax      # 0x10388
movq 0x86d7(%rip), %rcx      # 0x103b8
movq 0x86b8(%rip), %rdx      # 0x103a0
cmpq %rdx, %rcx
jae 0x7db0
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movabsq $0xf980000a000007, %rsi # imm = 0xF980000A000007
leaq 0x24b4(%rip), %rdi      # 0xa1c0
leaq 0x237d(%rip), %r8       # 0xa090
leaq 0x25c6(%rip), %r9       # 0xa2e0
leaq 0x251f(%rip), %r10      # 0xa240
movabsq $0x3990001a200300, %r11 # imm = 0x3990001A200300
leaq 0x258e(%rip), %rbx      # 0xa2c0
movzbl (%rcx), %r15d
testq %r15, %r15
je 0x7d48
leaq 0x21de(%rip), %r14      # 0x9f20
movb (%r15,%r14), %bpl
jmp 0x7d4b
movb $0x1, %bpl
btq %rax, %rsi
jb 0x7d5e
movl %eax, 0x8655(%rip)      # 0x103ac
movq %rcx, 0x8652(%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 0x7d99
btq %r15, %r11
jae 0x7d81
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 0x7d77
movswl (%r9,%r13,2), %eax
incq %rcx
cmpq %rdx, %rcx
jne 0x7d32
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x85d4(%rip), %rax      # 0x10390
testq %rax, %rax
je 0x7dcf
movq 0x85d0(%rip), %rcx      # 0x10398
cmpq $0x0, (%rax,%rcx,8)
jne 0x7df7
callq 0x7be2
movq 0x8595(%rip), %rdi      # 0x10370
movl $0x4000, %esi           # imm = 0x4000
callq 0x7c7a
movq 0x85a4(%rip), %rcx      # 0x10390
movq 0x85a5(%rip), %rdx      # 0x10398
movq %rax, (%rcx,%rdx,8)
movq 0x8592(%rip), %rax      # 0x10390
testq %rax, %rax
je 0x7e10
movq 0x858e(%rip), %rcx      # 0x10398
movq (%rax,%rcx,8), %rdi
jmp 0x7e12
xorl %edi, %edi
movq %rbx, %rsi
callq 0x7e85
movq 0x856f(%rip), %rax      # 0x10390
movq 0x8570(%rip), %rcx      # 0x10398
movq (%rax,%rcx,8), %rdx
movl 0x1c(%rdx), %esi
movl %esi, 0x858f(%rip)      # 0x103c4
movq 0x10(%rdx), %rdx
movq %rdx, 0x8560(%rip)      # 0x103a0
movq %rdx, 0x8571(%rip)      # 0x103b8
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq %rax, 0x851b(%rip)      # 0x10370
movb (%rdx), %al
movb %al, 0x854b(%rip)       # 0x103a8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x81f8
movq %rsi, %r14
movq %rdi, %r15
cmpb $0x0, -0x2(%rdi,%rsi)
jne 0x81f8
cmpb $0x0, -0x1(%r15,%r14)
je 0x8203
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movl $0x40, %edi
callq 0x2230
testq %rax, %rax
je 0x8251
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 0x7f06
jmp 0x81fa
leaq 0x2215(%rip), %rdi      # 0xa46d
callq 0x7e5f
// File: /workspace/github_c_makefile_star2_O1/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 0x82d6
movq %rax, %r15
testl %r14d, %r14d
jle 0x82a9
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 0x81d8
testq %rax, %rax
je 0x82e2
movl $0x1, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x21ba(%rip), %rdi      # 0xa497
callq 0x7e5f
leaq 0x21d7(%rip), %rdi      # 0xa4c0
callq 0x7e5f
// File: /workspace/github_c_makefile_star2_O1/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 0x804f(%rip), %rdi      # 0x10390
testq %rdi, %rdi
je 0x837b
movq 0x804b(%rip), %rax      # 0x10398
movq (%rdi,%rax,8), %rax
testq %rax, %rax
je 0x837b
movq %rax, %rdi
callq 0x7fb0
movq 0x802b(%rip), %rax      # 0x10390
movq 0x802c(%rip), %rcx      # 0x10398
movq $0x0, (%rax,%rcx,8)
callq 0x813b
jmp 0x833a
callq 0x2030
xorl %eax, %eax
movq %rax, 0x8007(%rip)      # 0x10390
movl $0x1, 0x5dfd(%rip)      # 0xe190
movq %rax, 0x7ffe(%rip)      # 0x10398
movq %rax, 0x802f(%rip)      # 0x103d0
movq %rax, 0x7ff8(%rip)      # 0x103a0
movb %al, 0x7fd6(%rip)       # 0x10384
movb %al, 0x7fd4(%rip)       # 0x10388
movq %rax, 0x7fb5(%rip)      # 0x10370
movq %rax, 0x7fb6(%rip)      # 0x10378
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/dropletzhu[P]msuite/tcpclient.c
// Function: long_lived_connection
void long_lived_connection(int sockfd)
{
	char buffer[1024];
	int retcode;

	memset(buffer, 0, 1024);
	while (1) {
		retcode = send(sockfd, buffer, 1024, 0);
		if (retcode < 0) {
			perror("send()");
			break;
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movl %edi, %ebx
movq %rsp, %r14
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x1070
movl $0x400, %edx            # imm = 0x400
movl %ebx, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x1050
testl %eax, %eax
jns 0x112e
leaq 0xed8(%rip), %rdi       # 0x2022
callq 0x10a0
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/dropletzhu[P]msuite/tcpclient.c
// Function: short_lived_connection
void short_lived_connection(int sockfd)
{
	char buffer[512];
	int retcode;

	memset(buffer, 0, 512);
	retcode = send(sockfd, buffer, 512, 0);
	printf("send %d bytes\n", retcode);

	retcode = recv(sockfd, buffer, 512, 0);
	printf("recv %d bytes\n", retcode);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movl %edi, %ebx
movq %rsp, %r14
movl $0x200, %edx            # imm = 0x200
movq %r14, %rdi
xorl %esi, %esi
callq 0x1070
movl $0x200, %edx            # imm = 0x200
movl %ebx, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x1050
leaq 0xd52(%rip), %rdi       # 0x2004
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
movl $0x200, %edx            # imm = 0x200
movl %ebx, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x1030
leaq 0xd40(%rip), %rdi       # 0x2013
movl %eax, %esi
xorl %eax, %eax
callq 0x1060
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/dropletzhu[P]msuite/tcpclient.c
// Function: usage
void usage()
{
	printf("Usage: ./tcpclient -s [server_ip] -p [port] -l\n");
	printf(" -s	server ip address\n");
	printf(" -p  server port\n");
	printf(" -l  long-lived connection, by default, it is short-lived echo connection\n");
}

// Assembly:
pushq %rax
leaq 0xd53(%rip), %rdi       # 0x2042
callq 0x1040
leaq 0xd76(%rip), %rdi       # 0x2071
callq 0x1040
leaq 0xd80(%rip), %rdi       # 0x2087
callq 0x1040
leaq 0xd85(%rip), %rdi       # 0x2098
popq %rax
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O1/dropletzhu[P]msuite/tcpclient.c
// Function: main
int main(int argc, char *argv[])
{
    int sockfd;
    struct sockaddr_in their_addr;
	struct in_addr server_ip;
	int port;
	char ch;
	int retcode;
	int long_lived = 0;

    if (argc < 2) {
        usage();
        return -1;
    }

    while ((ch = getopt (argc, argv, "s:p:l")) != -1) {
        switch (ch) {
		case 's':
			retcode = inet_aton(optarg, &server_ip);
			if (retcode == 0) {
				printf("wrong address format\n");
				return -1;
			}
        case 'p':
            port = atoi(optarg);
            break;
        case 'l':
            long_lived = 1;
            break;
        default:
            usage();
            return -1;
        }
    }

    if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
        perror("socket()");
        exit(-1);
    }

    their_addr.sin_family = AF_INET;
    their_addr.sin_port = htons(port);
    their_addr.sin_addr.s_addr = server_ip.s_addr;
    memset(&(their_addr.sin_zero), '\0', 8);

    if(connect(sockfd, (struct sockaddr *)&their_addr, sizeof(struct sockaddr)) == -1) {
        perror("connect()");
        exit(-1);
    }

	if (long_lived) {
		long_lived_connection(sockfd);
	} else {
		short_lived_connection(sockfd);
	}
 
    close(sockfd);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x2, %edi
jge 0x133b
callq 0x12e7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1425
movq %rsi, %rbx
movl %edi, %ebp
leaq 0xce2(%rip), %rdx       # 0x2029
callq 0x10b0
shll $0x18, %eax
cmpl $0xff000000, %eax       # imm = 0xFF000000
jne 0x135b
movb $0x1, %bpl
jmp 0x13c4
xorl %r13d, %r13d
leaq 0xcc4(%rip), %r14       # 0x2029
movq 0x2c74(%rip), %r15      # 0x3fe0
sarl $0x18, %eax
cmpl $0x6c, %eax
je 0x13a0
cmpl $0x70, %eax
je 0x1393
cmpl $0x73, %eax
jne 0x132c
movq (%r15), %rdi
leaq 0x4(%rsp), %rsi
callq 0x1090
testl %eax, %eax
je 0x1434
movq (%r15), %rdi
callq 0x10c0
movl %eax, %r12d
jmp 0x13a6
movl $0x1, %r13d
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x10b0
shll $0x18, %eax
cmpl $0xff000000, %eax       # imm = 0xFF000000
jne 0x136c
testl %r13d, %r13d
sete %bpl
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x144c
movl %eax, %ebx
leaq 0x8(%rsp), %rsi
movw $0x2, (%rsi)
rolw $0x8, %r12w
movw %r12w, 0x2(%rsi)
movl 0x4(%rsp), %eax
movl %eax, 0x4(%rsi)
movq $0x0, 0x8(%rsi)
movl %ebx, %edi
movl $0x10, %edx
callq 0x10e0
cmpl $-0x1, %eax
je 0x1451
movl %ebx, %edi
testb %bpl, %bpl
je 0x1445
callq 0x127c
movl %ebx, %edi
callq 0x1080
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xca7(%rip), %rdi       # 0x20e2
callq 0x1040
jmp 0x1331
callq 0x1110
jmp 0x141c
callq 0x116f
callq 0x115a
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/u_kb11a.c
// Function: dumpromw
void
dumpromw(Uword w)
{
	printf("%o\t%o\t%o\t%o\t%o\t%o\t%o\t%o\t%o"
		"\t%o\t%o\t%o\t%o\t%o\t%o\t%o\t%o\t%o"
		"\t%o\t%o\t%o\t%o\t%o\t%o\t%o\t%o\t%o\n",
		w.brk,
		w.brx,
		w.srx,
		w.drx,
		w.srk,
		w.drk,
		w.ccl,
		w.pca,
		w.pcb,
		w.shf,
		w.irk,
		w.pwe,
		w.pad,
		w.bsd,
		w.bax,
		w.ibs,
		w.shc,
		w.bct,
		w.msc,
		w.bsc,
		w.amx,
		w.bmx,
		w.kmx,
		w.alu,
		w.fen,
		w.bef,
		w.adr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl 0xb0(%rsp), %esi
movl 0xb4(%rsp), %edx
movl 0xb8(%rsp), %ecx
movl 0xbc(%rsp), %r8d
movl 0xc0(%rsp), %r9d
movl 0xc4(%rsp), %eax
movq %rax, 0x70(%rsp)
movl 0xc8(%rsp), %eax
movq %rax, 0x68(%rsp)
movl 0xcc(%rsp), %eax
movq %rax, 0x60(%rsp)
movl 0xd0(%rsp), %eax
movq %rax, 0x58(%rsp)
movl 0xd4(%rsp), %eax
movq %rax, 0x50(%rsp)
movl 0xd8(%rsp), %eax
movq %rax, 0x48(%rsp)
movl 0xdc(%rsp), %eax
movq %rax, 0x40(%rsp)
movl 0xe0(%rsp), %eax
movq %rax, 0x38(%rsp)
movl 0xe4(%rsp), %eax
movq %rax, 0x30(%rsp)
movl 0xe8(%rsp), %eax
movq %rax, 0x28(%rsp)
movl 0xec(%rsp), %eax
movq %rax, 0x20(%rsp)
movl 0xf0(%rsp), %eax
movq %rax, 0x18(%rsp)
movl 0xf4(%rsp), %eax
movq %rax, 0x10(%rsp)
movl 0xf8(%rsp), %eax
movq %rax, 0x8(%rsp)
movl 0xfc(%rsp), %r13d
movl 0x100(%rsp), %ebp
movl 0x104(%rsp), %r10d
movl 0x108(%rsp), %r11d
movl 0x10c(%rsp), %ebx
movl 0x110(%rsp), %r14d
movl 0x114(%rsp), %r15d
movl 0x118(%rsp), %r12d
leaq 0x2571(%rip), %rdi      # 0x481d
xorl %eax, %eax
pushq %r12
pushq %r15
pushq %r14
pushq %rbx
pushq %r11
pushq %r10
pushq %rbp
pushq %r13
pushq 0x48(%rsp)
pushq 0x58(%rsp)
pushq 0x68(%rsp)
pushq 0x78(%rsp)
pushq 0x88(%rsp)
pushq 0x98(%rsp)
pushq 0xa8(%rsp)
pushq 0xb8(%rsp)
pushq 0xc8(%rsp)
pushq 0xd8(%rsp)
pushq 0xe8(%rsp)
pushq 0xf8(%rsp)
pushq 0x108(%rsp)
pushq 0x118(%rsp)
callq 0x2040
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/u_kb11a.c
// Function: dumpstate
void
dumpstate(KB11A *kb)
{
	printf("A/%06o B/%06o BA/%06o\n",
		kb->amx, kb->bmx, kb->bamx);
	printf("ALU/%07o SHFR/%06o\n",
		kb->alu, kb->shfr);
	printf("PCA/%06o PCB/%06o\n",
		kb->c.pca, kb->c.pcb);
	printf("SR/%06o DR/%06o\n",
		kb->c.sr, kb->c.dr);
	printf("BR/%06o IR/%06o\n",
		kb->c.br, kb->c.ir);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movzwl 0x210(%rdi), %esi
movzwl 0x212(%rdi), %edx
movzwl 0x214(%rdi), %ecx
leaq 0x2526(%rip), %rdi      # 0x486f
xorl %eax, %eax
callq 0x2040
movl 0x21c(%rbx), %esi
movzwl 0x216(%rbx), %edx
leaq 0x2522(%rip), %rdi      # 0x4886
xorl %eax, %eax
callq 0x2040
movzwl 0x2(%rbx), %esi
movzwl 0x4(%rbx), %edx
leaq 0x2520(%rip), %rdi      # 0x489a
xorl %eax, %eax
callq 0x2040
movzwl 0x6(%rbx), %esi
movzwl 0x8(%rbx), %edx
leaq 0x251d(%rip), %rdi      # 0x48ad
xorl %eax, %eax
callq 0x2040
movzwl (%rbx), %esi
movzwl 0xc(%rbx), %edx
leaq 0x2519(%rip), %rdi      # 0x48be
xorl %eax, %eax
popq %rbx
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O1/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), %edx
testl %edx, %edx
jne 0x2488
testb $0x8, 0x99(%rdi)
je 0x2488
movl $0x8, %ecx
cmpl $0x6, 0x220(%rdi)
jl 0x24a2
xorl %ecx, %ecx
testb $0x40, 0x99(%rdi)
je 0x24a2
xorl %ecx, %ecx
cmpl $0x6, 0x220(%rdi)
sete %cl
shll $0x3, %ecx
movl 0x48(%rdi), %esi
movl $0x5, %eax
cmpq $0x7, %rsi
ja 0x2534
leaq 0x1b69(%rip), %r8       # 0x4024
movslq (%r8,%rsi,4), %rsi
addq %r8, %rsi
jmpq *%rsi
movl 0x220(%rdi), %edx
cmpw $0x0, 0x98(%rdi)
sets %al
cmpl $0x6, %edx
sete %sil
andb %al, %sil
movzbl %sil, %eax
jmp 0x252e
movl 0x220(%rdi), %eax
orl $0x1, %eax
jmp 0x2534
xorl %eax, %eax
cmpw $0x0, 0x98(%rdi)
setns %al
xorl $0x7, %eax
jmp 0x2534
movl 0x224(%rdi), %eax
movl %eax, %esi
xorl $0x6, %esi
orl %esi, %edx
jne 0x251e
movw $0x2000, %dx            # imm = 0x2000
cmpl $0x0, 0x22c(%rdi)
jne 0x2522
movw $0x8000, %dx            # imm = 0x8000
movzwl 0x98(%rdi), %esi
movzwl %dx, %edx
andl %esi, %edx
orl %edx, %eax
jmp 0x2534
xorl %eax, %eax
orl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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), %edx
testl %edx, %edx
jne 0x2558
testb $0x8, 0x99(%rdi)
je 0x2558
movl $0x8, %ecx
cmpl $0x6, 0x224(%rdi)
jl 0x257b
xorl %ecx, %ecx
testb $0x40, 0x99(%rdi)
je 0x257b
cmpl $0x6, 0x224(%rdi)
jne 0x257b
xorl %ecx, %ecx
cmpl $0x0, 0x22c(%rdi)
sete %cl
shll $0x3, %ecx
movl 0x48(%rdi), %esi
movl $0x5, %eax
cmpq $0x7, %rsi
ja 0x260d
leaq 0x1ab0(%rip), %r8       # 0x4044
movslq (%r8,%rsi,4), %rsi
addq %r8, %rsi
jmpq *%rsi
movl 0x224(%rdi), %eax
movl %eax, %esi
xorl $0x6, %esi
orl %esi, %edx
jne 0x25b9
movw $0x2000, %dx            # imm = 0x2000
cmpl $0x0, 0x22c(%rdi)
jne 0x25bd
movw $0x8000, %dx            # imm = 0x8000
movzwl 0x98(%rdi), %esi
movzwl %dx, %edx
andl %esi, %edx
jmp 0x260b
xorl %eax, %eax
cmpw $0x0, 0x98(%rdi)
setns %al
xorl $0x7, %eax
jmp 0x260d
movl 0x220(%rdi), %eax
orl $0x1, %eax
jmp 0x260d
xorl %eax, %eax
jmp 0x260d
movl 0x220(%rdi), %edx
cmpw $0x0, 0x98(%rdi)
sets %al
cmpl $0x6, %edx
sete %sil
andb %al, %sil
movzbl %sil, %eax
orl %edx, %eax
orl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2664
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 0x263c
testb $0x2, %cl
je 0x2652
cmpw $0x7, %ax
je 0x2652
movq %rbx, %rdi
callq 0x2467
cltq
leaq (%rbx,%rax,2), %rax
addq $0x140, %rax            # imm = 0x140
jmp 0x2659
leaq 0x216(%rbx), %rax
movzwl (%rax), %eax
movw %ax, 0xa6(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2694
cmpl $0x2, %eax
je 0x268d
cmpl $0x1, %eax
jne 0x26e4
movzwl 0x8(%rbx), %ecx
movzwl 0x21c(%rbx), %eax
shldw $0xf, %cx, %ax
jmp 0x26dd
movl 0x8(%rbx), %eax
addl %eax, %eax
jmp 0x26dd
movl 0x24(%rbx), %ecx
cmpl $0x3, %ecx
jne 0x26a0
xorl %eax, %eax
jmp 0x26dd
movzwl 0xc(%rbx), %eax
andl $0x7, %eax
movl %eax, 0x224(%rbx)
cmpl $0x1, %ecx
je 0x26bd
testb $0x2, %cl
je 0x26d3
cmpw $0x7, %ax
je 0x26d3
movq %rbx, %rdi
callq 0x2537
cltq
leaq (%rbx,%rax,2), %rax
addq $0x160, %rax            # imm = 0x160
jmp 0x26da
leaq 0x216(%rbx), %rax
movzwl (%rax), %eax
movw %ax, 0xa8(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2b45
movzbl %al, %esi
orl %r13d, %esi
andl %r15d, %esi
testb $0x2, %bpl
cmovnel %r14d, %esi
andl %r12d, %esi
movw %si, 0x180(%rbx)
leaq 0x1ba5(%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_O1/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 0x1bac(%rip), %rdi      # 0x4955
callq 0x2030
movl 0x1bc(%rbx), %eax
movl %eax, 0xec(%rbx)
movups 0x1c0(%rbx), %xmm0
movups %xmm0, 0xf0(%rbx)
movups 0x1d0(%rbx), %xmm0
movups %xmm0, 0x100(%rbx)
movq 0x1e0(%rbx), %rax
movq %rax, 0x110(%rbx)
movq %rbx, %rdi
callq 0x2610
movq %rbx, %rdi
callq 0x2665
cmpl $0x3, 0x2c(%rbx)
jne 0x2e0a
movzwl 0xa8(%rbx), %eax
andl $0x1, %eax
movl %eax, 0x230(%rbx)
cmpl $0x0, 0x18(%rbx)
je 0x2e3b
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 0x1b12(%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 0x2070
movq %rbx, %rdi
popq %rbx
jmp 0x26e6
// File: /workspace/github_c_makefile_star2_O1/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 0x1ad9(%rip), %rdi      # 0x4958
callq 0x2030
movl 0x188(%rbx), %eax
leaq 0xa0(%rbx), %rsi
movl %eax, 0xb8(%rbx)
movups 0x18c(%rbx), %xmm0
movups %xmm0, 0xbc(%rbx)
movups 0x19c(%rbx), %xmm0
movups %xmm0, 0xcc(%rbx)
movq 0x1ac(%rbx), %rax
movq %rax, 0xdc(%rbx)
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x2070
movq %rbx, %rdi
popq %rbx
jmp 0x26e6
// File: /workspace/github_c_makefile_star2_O1/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 0x1a72(%rip), %rdi      # 0x495b
callq 0x2030
movq %rbx, %rdi
callq 0x2d2b
movb 0x180(%rbx), %al
movb %al, 0xb6(%rbx)
cmpl $0x7, 0x5c(%rbx)
jne 0x2f14
leaq 0x1a4f(%rip), %rdi      # 0x495e
callq 0x2030
cmpl $0x6, 0x60(%rbx)
jne 0x2f26
leaq 0x1a4a(%rip), %rdi      # 0x496b
callq 0x2030
leaq 0xa0(%rbx), %rsi
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x26e6
movzbl 0x16(%rbx), %ecx
addq $0x188, %rbx            # imm = 0x188
shll $0x7, %ecx
leaq 0x4169(%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_O1/aap[P]pdp11/u_kb11a.c
// Function: power
void
power(KB11A *kb)
{
	// TODO: don't do this
	memset(kb, 0, sizeof(KB11A));

	kb->ps_restore = 0;
	// eh?
	kb->conf = 1;

	memset(&kb->n.rbr, 0, sizeof(Uword));
	zap(kb);

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

// Assembly:
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
movl $0x258, %edx            # imm = 0x258
xorl %esi, %esi
callq 0x2060
movl $0x1, 0x234(%rbx)
leaq 0xa0(%rbx), %rsi
xorps %xmm0, %xmm0
movups %xmm0, 0xb8(%rbx)
movups %xmm0, 0xc8(%rbx)
movups %xmm0, 0xd8(%rbx)
movups %xmm0, 0xe8(%rbx)
movups %xmm0, 0xf8(%rbx)
movups %xmm0, 0x108(%rbx)
movups %xmm0, 0x118(%rbx)
movups %xmm0, 0x128(%rbx)
movb $-0x80, 0xb6(%rbx)
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x2070
movzbl 0x16(%rbx), %ecx
addq $0x188, %rbx            # imm = 0x188
shll $0x7, %ecx
leaq 0x404e(%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_O1/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 0x1898(%rip), %r12      # 0x497e
leaq 0x1894(%rip), %r13      # 0x4981
leaq 0x189c(%rip), %rbp      # 0x4990
movq %rbx, %rdi
callq 0x2d9e
movq %rbx, %rdi
callq 0x2329
movq %rbx, %rdi
callq 0x2e74
movq %rbx, %rdi
callq 0x2329
cmpl $0x1, 0x4c(%rbx)
jne 0x3126
leaq 0x1863(%rip), %rdi      # 0x4984
callq 0x2030
movq %rbx, %rdi
callq 0x2ed7
movq %rbx, %rdi
callq 0x2329
movq %r12, %rdi
callq 0x2030
movl $0xa0, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2070
movq %rbx, %rdi
callq 0x26e6
movq %rbx, %rdi
callq 0x2329
movq %r13, %rdi
callq 0x2030
movl $0xa0, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2070
movq %rbx, %rdi
callq 0x26e6
movq %rbx, %rdi
callq 0x2329
movq %rbp, %rdi
callq 0x2030
decl %r15d
jne 0x30f4
movq %rbx, %rdi
callq 0x2d9e
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_O1/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 $0x258, %edi            # imm = 0x258
callq 0x2080
movq %rax, %rbx
movl $0x258, %edx            # imm = 0x258
movq %rax, %rdi
xorl %esi, %esi
callq 0x2060
movl $0x1, 0x234(%rbx)
leaq 0xa0(%rbx), %rsi
xorps %xmm0, %xmm0
movups %xmm0, 0xb8(%rbx)
movups %xmm0, 0xc8(%rbx)
movups %xmm0, 0xd8(%rbx)
movups %xmm0, 0xe8(%rbx)
movups %xmm0, 0xf8(%rbx)
movups %xmm0, 0x108(%rbx)
movups %xmm0, 0x118(%rbx)
movups %xmm0, 0x128(%rbx)
movb $-0x80, 0xb6(%rbx)
movl $0xa0, %edx
movq %rbx, %rdi
callq 0x2070
leaq 0x188(%rbx), %rdi
movzbl 0x16(%rbx), %ecx
shll $0x7, %ecx
leaq 0x3e72(%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 0x309f
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x138d
leaq -0xa0(%rbp), %rsi
movq %rbx, %rdi
callq 0x1050
testl %eax, %eax
js 0x1396
movl $0xf000, %eax           # imm = 0xF000
andl -0x88(%rbp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x139f
leaq 0xc9c(%rip), %rsi       # 0x2004
movq %rbx, %rdi
callq 0x1070
movq 0x2c69(%rip), %rcx      # 0x3fe0
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x12b9
xorl %eax, %eax
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xc88(%rip), %rdi       # 0x201c
jmp 0x13a6
leaq 0xc72(%rip), %rdi       # 0x200f
jmp 0x13a6
leaq 0xc60(%rip), %rdi       # 0x2006
callq 0x1080
jmp 0x1382
// File: /workspace/github_c_makefile_star2_O1/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 0x1a6b1(%rip), %r15     # 0x1dff0
movq (%r15), %rdi
movq (%rbx), %rdx
leaq 0x14162(%rip), %rsi     # 0x17aae
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x8(%rbx), %rdx
leaq 0x14164(%rip), %rsi     # 0x17ac5
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x10(%rbx), %rdx
leaq 0x14163(%rip), %rsi     # 0x17ad9
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x18(%rbx), %rdx
leaq 0x14164(%rip), %rsi     # 0x17aef
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x28(%rbx), %rdx
leaq 0x14164(%rip), %rsi     # 0x17b04
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x20(%rbx), %rdx
leaq 0x14164(%rip), %rsi     # 0x17b19
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x50(%rbx), %rdx
leaq 0x14168(%rip), %rsi     # 0x17b32
xorl %eax, %eax
callq 0x3340
movq (%r15), %rdi
movq 0x48(%rbx), %rdx
leaq 0x1416c(%rip), %rsi     # 0x17b4b
xorl %eax, %eax
callq 0x3340
cmpl $0x0, 0x1d8(%rbx)
jle 0x3a21
leaq 0x1416f(%rip), %r14     # 0x17b65
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 0x39f9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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 $0x38, %rsp
movl %esi, %ebx
movq %rdi, %r14
xorl %r12d, %r12d
movl $0x2, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x3670
movl %eax, 0x8(%rsp)
callq 0x3430
testq %rax, %rax
je 0x3c8f
movq %rax, %r15
movl %ebx, 0xc(%rsp)
movslq %ebx, %rbx
leaq 0x13a2f(%rip), %r13     # 0x17605
movl 0x8(%rsp), %r12d
cmpl $0x0, (%r15)
jne 0x3bec
cmpq $0x0, 0x8(%r15)
je 0x3c87
movq 0x8(%r15), %rsi
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
callq 0x30e0
movl $0x8927, %esi           # imm = 0x8927
movl %r12d, %edi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x3250
testl %eax, %eax
jne 0x3c7e
movb 0x23(%rsp), %al
orb 0x22(%rsp), %al
movb 0x25(%rsp), %cl
orb 0x24(%rsp), %cl
orb 0x26(%rsp), %cl
orb %al, %cl
orb 0x27(%rsp), %cl
sete %al
je 0x3c7e
movb %al, 0x7(%rsp)
cmpl $0x0, 0xc(%rsp)
jle 0x3c72
movl $0x2, %r12d
xorl %ebp, %ebp
leaq (%r14,%r12), %rdi
addq $-0x2, %rdi
movzbl 0x22(%rsp,%rbp), %edx
movq %r13, %rsi
xorl %eax, %eax
callq 0x35a0
cmpq $0x4, %rbp
ja 0x3c72
incq %rbp
leaq 0x2(%r12), %rax
cmpq %rbx, %r12
movq %rax, %r12
jl 0x3c45
cmpb $0x0, 0x7(%rsp)
movl 0x8(%rsp), %r12d
je 0x3c8c
addq $0x10, %r15
jmp 0x3bdb
xorl %r12d, %r12d
jmp 0x3c8f
movb $0x1, %r12b
movl %r12d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x1a303(%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 0x3d1f
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 0x3b8c
testb %al, %al
jne 0x3d1f
callq 0x3130
leaq 0x112f4(%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_O1/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, 0x1a60f(%rip)     # 0x1e350
je 0x3d98
cmpq $0x0, 0x1a65d(%rip)     # 0x1e3a8
je 0x3d98
movq %rdi, %r14
movzwl 0x1a649(%rip), %eax     # 0x1e3a0
incw %ax
movl $0x1, %ebp
cmovnel %eax, %ebp
movw %bp, 0x1a637(%rip)      # 0x1e3a0
movq 0x1a658(%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 0x1184f
movq 0x1a251(%rip), %rax     # 0x1dff0
movq (%rax), %rdi
leaq 0x11260(%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_O1/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 0x1a5eb(%rip), %rsi     # 0x1e3b0
leaq 0x1b(%rip), %rdx        # 0x3de7
callq 0x8a17
testq %rax, %rax
je 0x3de2
movl $0x0, 0x1a570(%rip)     # 0x1e350
popq %rax
retq
callq 0x3728
// File: /workspace/github_c_makefile_star2_O1/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 0x1a585(%rip), %rdi     # 0x1e3d0
leaq 0x132cd(%rip), %rsi     # 0x1711f
callq 0x3520
movq %rax, %rbx
testq %rax, %rax
je 0x3f03
movq %rbx, %rdi
testb %bpl, %bpl
je 0x3ee2
movq $-0x1, %rsi
movl $0x2, %edx
callq 0x3480
movq %rbx, %rdi
callq 0x3270
movl %eax, %ebp
cmpb $0xa, %bpl
jne 0x3ea4
movq %rbx, %rdi
movq $-0x2, %rsi
movl $0x1, %edx
callq 0x3480
testl %eax, %eax
je 0x3e7c
cmpb $0xa, %bpl
je 0x3ece
movq %rbx, %rdi
movq $-0x2, %rsi
movl $0x1, %edx
callq 0x3480
testl %eax, %eax
jne 0x3ef2
movq %rbx, %rdi
callq 0x3270
cmpb $0xa, %al
jne 0x3eaa
movl $0x1, %esi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x3480
jmp 0x3ef2
xorl %esi, %esi
movl $0x2, %edx
callq 0x3480
testl %eax, %eax
jne 0x3f16
movq %rbx, 0x1a697(%rip)     # 0x1e590
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x382e
movq (%rbx), %rbx
jmp 0x3e63
callq 0x38dc
jmp 0x3ef2