LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
leaq 0x10(%rbp), %rdi
movl (%rdi), %esi
movl 0x4(%rdi), %edx
movl 0x8(%rdi), %ecx
movl 0xc(%rdi), %r8d
movl 0x10(%rdi), %r9d
movl 0x14(%rdi), %eax
movl 0x18(%rdi), %r10d
movl %r10d, -0x60(%rbp)
movl 0x1c(%rdi), %r10d
movl %r10d, -0x5c(%rbp)
movl 0x20(%rdi), %r10d
movl %r10d, -0x58(%rbp)
movl 0x24(%rdi), %r10d
movl %r10d, -0x54(%rbp)
movl 0x28(%rdi), %r10d
movl %r10d, -0x50(%rbp)
movl 0x2c(%rdi), %r10d
movl %r10d, -0x4c(%rbp)
movl 0x30(%rdi), %r10d
movl %r10d, -0x48(%rbp)
movl 0x34(%rdi), %r10d
movl %r10d, -0x44(%rbp)
movl 0x38(%rdi), %r10d
movl %r10d, -0x40(%rbp)
movl 0x3c(%rdi), %r10d
movl %r10d, -0x3c(%rbp)
movl 0x40(%rdi), %r10d
movl %r10d, -0x38(%rbp)
movl 0x44(%rdi), %r10d
movl %r10d, -0x34(%rbp)
movl 0x48(%rdi), %r10d
movl %r10d, -0x30(%rbp)
movl 0x4c(%rdi), %r13d
movl 0x50(%rdi), %r12d
movl 0x54(%rdi), %r15d
movl 0x58(%rdi), %r14d
movl 0x5c(%rdi), %ebx
movl 0x60(%rdi), %r11d
movl 0x64(%rdi), %r10d
movl 0x68(%rdi), %edi
movl %edi, -0x2c(%rbp)
leaq 0x35d6(%rip), %rdi      # 0x5811
movl %eax, (%rsp)
movl -0x60(%rbp), %eax
movl %eax, 0x8(%rsp)
movl -0x5c(%rbp), %eax
movl %eax, 0x10(%rsp)
movl -0x58(%rbp), %eax
movl %eax, 0x18(%rsp)
movl -0x54(%rbp), %eax
movl %eax, 0x20(%rsp)
movl -0x50(%rbp), %eax
movl %eax, 0x28(%rsp)
movl -0x4c(%rbp), %eax
movl %eax, 0x30(%rsp)
movl -0x48(%rbp), %eax
movl %eax, 0x38(%rsp)
movl -0x44(%rbp), %eax
movl %eax, 0x40(%rsp)
movl -0x40(%rbp), %eax
movl %eax, 0x48(%rsp)
movl -0x3c(%rbp), %eax
movl %eax, 0x50(%rsp)
movl -0x38(%rbp), %eax
movl %eax, 0x58(%rsp)
movl -0x34(%rbp), %eax
movl %eax, 0x60(%rsp)
movl -0x30(%rbp), %eax
movl %eax, 0x68(%rsp)
movl -0x2c(%rbp), %eax
movl %r13d, 0x70(%rsp)
movl %r12d, 0x78(%rsp)
movl %r15d, 0x80(%rsp)
movl %r14d, 0x88(%rsp)
movl %ebx, 0x90(%rsp)
movl %r11d, 0x98(%rsp)
movl %r10d, 0xa0(%rsp)
movl %eax, 0xa8(%rsp)
movb $0x0, %al
callq 0x2030
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x210(%rax), %esi
movq -0x8(%rbp), %rax
movzwl 0x212(%rax), %edx
movq -0x8(%rbp), %rax
movzwl 0x214(%rax), %ecx
leaq 0x353f(%rip), %rdi      # 0x5863
movb $0x0, %al
callq 0x2030
movq -0x8(%rbp), %rax
movl 0x21c(%rax), %esi
movq -0x8(%rbp), %rax
movzwl 0x216(%rax), %edx
leaq 0x3533(%rip), %rdi      # 0x587a
movb $0x0, %al
callq 0x2030
movq -0x8(%rbp), %rax
movzwl 0x2(%rax), %esi
movq -0x8(%rbp), %rax
movzwl 0x4(%rax), %edx
leaq 0x3529(%rip), %rdi      # 0x588e
movb $0x0, %al
callq 0x2030
movq -0x8(%rbp), %rax
movzwl 0x6(%rax), %esi
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %edx
leaq 0x351e(%rip), %rdi      # 0x58a1
movb $0x0, %al
callq 0x2030
movq -0x8(%rbp), %rax
movzwl (%rax), %esi
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %edx
leaq 0x3512(%rip), %rdi      # 0x58b2
movb $0x0, %al
callq 0x2030
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x23c(%rax)
jne 0x2adc
movq -0x8(%rbp), %rax
movzwl 0x98(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x2adc
movq -0x8(%rbp), %rcx
movb $0x1, %al
cmpl $0x6, 0x220(%rcx)
movb %al, -0x11(%rbp)
jl 0x2b0e
movq -0x8(%rbp), %rax
movzwl 0x98(%rax), %ecx
andl $0x4000, %ecx           # imm = 0x4000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x12(%rbp)
je 0x2b08
movq -0x8(%rbp), %rax
cmpl $0x6, 0x220(%rax)
sete %al
movb %al, -0x12(%rbp)
movb -0x12(%rbp), %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
movzbl %al, %eax
andl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x48(%rax), %eax
movq %rax, -0x20(%rbp)
subq $0x7, %rax
ja 0x2c4c
movq -0x20(%rbp), %rax
leaq 0x24ca(%rip), %rcx      # 0x5004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movl 0x220(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x98(%rax), %ecx
andl $0x8000, %ecx           # imm = 0x8000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x21(%rbp)
je 0x2b7c
movq -0x8(%rbp), %rax
cmpl $0x6, 0x220(%rax)
sete %al
movb %al, -0x21(%rbp)
movl -0x28(%rbp), %eax
movb -0x21(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
orl %ecx, %eax
movl %eax, -0x10(%rbp)
jmp 0x2c4c
movq -0x8(%rbp), %rax
movl 0x220(%rax), %eax
orl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2c4c
movl $0x5, -0x10(%rbp)
jmp 0x2c4c
movl $0x0, -0x10(%rbp)
jmp 0x2c4c
movq -0x8(%rbp), %rax
movl 0x224(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x23c(%rax)
jne 0x2c08
movq -0x8(%rbp), %rax
cmpl $0x6, 0x224(%rax)
jne 0x2c08
movq -0x8(%rbp), %rax
cmpl $0x0, 0x22c(%rax)
je 0x2c08
movq -0x8(%rbp), %rax
movzwl 0x98(%rax), %eax
andl $0x2000, %eax           # imm = 0x2000
movl %eax, -0x30(%rbp)
jmp 0x2c1b
movq -0x8(%rbp), %rax
movzwl 0x98(%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
orl %ecx, %eax
movl %eax, -0x10(%rbp)
jmp 0x2c4c
movq -0x8(%rbp), %rax
movzwl 0x98(%rax), %edx
andl $0x8000, %edx           # imm = 0x8000
movl $0x6, %eax
movl $0x7, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
shll $0x3, %ecx
orl %ecx, %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x23c(%rax)
jne 0x2c9c
movq -0x8(%rbp), %rax
movzwl 0x98(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x2c9c
movq -0x8(%rbp), %rcx
movb $0x1, %al
cmpl $0x6, 0x224(%rcx)
movb %al, -0x11(%rbp)
jl 0x2ce2
movq -0x8(%rbp), %rax
movzwl 0x98(%rax), %ecx
andl $0x4000, %ecx           # imm = 0x4000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x12(%rbp)
je 0x2cdc
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl $0x6, 0x224(%rcx)
movb %al, -0x12(%rbp)
jne 0x2cdc
movq -0x8(%rbp), %rax
cmpl $0x0, 0x22c(%rax)
setne %al
xorb $-0x1, %al
movb %al, -0x12(%rbp)
movb -0x12(%rbp), %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
movzbl %al, %eax
andl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x48(%rax), %eax
movq %rax, -0x20(%rbp)
subq $0x7, %rax
ja 0x2e1a
movq -0x20(%rbp), %rax
leaq 0x2316(%rip), %rcx      # 0x5024
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movl 0x220(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x98(%rax), %ecx
andl $0x8000, %ecx           # imm = 0x8000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x21(%rbp)
je 0x2d50
movq -0x8(%rbp), %rax
cmpl $0x6, 0x220(%rax)
sete %al
movb %al, -0x21(%rbp)
movl -0x28(%rbp), %eax
movb -0x21(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
orl %ecx, %eax
movl %eax, -0x10(%rbp)
jmp 0x2e1a
movq -0x8(%rbp), %rax
movl 0x220(%rax), %eax
orl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2e1a
movq -0x8(%rbp), %rax
movl 0x224(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x23c(%rax)
jne 0x2dc4
movq -0x8(%rbp), %rax
cmpl $0x6, 0x224(%rax)
jne 0x2dc4
movq -0x8(%rbp), %rax
cmpl $0x0, 0x22c(%rax)
je 0x2dc4
movq -0x8(%rbp), %rax
movzwl 0x98(%rax), %eax
andl $0x2000, %eax           # imm = 0x2000
movl %eax, -0x30(%rbp)
jmp 0x2dd7
movq -0x8(%rbp), %rax
movzwl 0x98(%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
orl %ecx, %eax
movl %eax, -0x10(%rbp)
jmp 0x2e1a
movl $0x5, -0x10(%rbp)
jmp 0x2e1a
movl $0x0, -0x10(%rbp)
jmp 0x2e1a
movq -0x8(%rbp), %rax
movzwl 0x98(%rax), %edx
andl $0x8000, %edx           # imm = 0x8000
movl $0x6, %eax
movl $0x7, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl -0xc(%rbp), %ecx
shll $0x3, %ecx
orl %ecx, %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x2ef3
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
sarl $0x6, %ecx
andl $0x7, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x220(%rax)
movq -0x8(%rbp), %rcx
movb $0x1, %al
cmpl $0x1, 0x20(%rcx)
movb %al, -0xd(%rbp)
je 0x2e9c
movq -0x8(%rbp), %rax
movl 0x20(%rax), %ecx
andl $0x2, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xe(%rbp)
je 0x2e96
movq -0x8(%rbp), %rax
cmpl $0x7, 0x220(%rax)
setne %al
movb %al, -0xe(%rbp)
movb -0xe(%rbp), %al
movb %al, -0xd(%rbp)
movb -0xd(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x2ed4
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2aa0
movl %eax, %ecx
movq -0x20(%rbp), %rax
movslq %ecx, %rcx
movzwl 0x140(%rax,%rcx,2), %eax
movl %eax, -0x14(%rbp)
jmp 0x2ee2
movq -0x8(%rbp), %rax
movzwl 0x216(%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0xa6(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %eax
movq %rax, -0x18(%rbp)
subq $0x3, %rax
ja 0x3047
movq -0x18(%rbp), %rax
leaq 0x2118(%rip), %rcx      # 0x5044
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x3047
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
sarl %eax
movq -0x8(%rbp), %rcx
movl 0x21c(%rcx), %ecx
shll $0xf, %ecx
orl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0xa8(%rax)
jmp 0x3047
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
shll %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0xa8(%rax)
jmp 0x3047
movq -0x8(%rbp), %rax
cmpl $0x3, 0x24(%rax)
jne 0x2f9f
movq -0x8(%rbp), %rax
movw $0x0, 0xa8(%rax)
jmp 0x3045
movq -0x8(%rbp), %rax
movzwl 0xc(%rax), %ecx
andl $0x7, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x224(%rax)
movq -0x8(%rbp), %rcx
movb $0x1, %al
cmpl $0x1, 0x24(%rcx)
movb %al, -0x19(%rbp)
je 0x2fee
movq -0x8(%rbp), %rax
movl 0x24(%rax), %ecx
andl $0x2, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x1a(%rbp)
je 0x2fe8
movq -0x8(%rbp), %rax
cmpl $0x7, 0x224(%rax)
setne %al
movb %al, -0x1a(%rbp)
movb -0x1a(%rbp), %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x3026
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2c60
movl %eax, %ecx
movq -0x28(%rbp), %rax
movslq %ecx, %rcx
movzwl 0x160(%rax,%rcx,2), %eax
movl %eax, -0x20(%rbp)
jmp 0x3034
movq -0x8(%rbp), %rax
movzwl 0x216(%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0xa8(%rax)
jmp 0x3047
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x78(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3b0c
movq -0x8(%rbp), %rdi
callq 0x3870
movzbl %al, %eax
movl %eax, -0x10(%rbp)
jmp 0x3b16
movl $0xff, %eax
movl %eax, -0x10(%rbp)
jmp 0x3b16
movl -0x10(%rbp), %eax
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movl 0x78(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3b3c
movq -0x8(%rbp), %rdi
callq 0x3880
movzbl %al, %eax
movl %eax, -0x14(%rbp)
jmp 0x3b46
movl $0xff, %eax
movl %eax, -0x14(%rbp)
jmp 0x3b46
movl -0x14(%rbp), %eax
movb %al, -0xa(%rbp)
movq -0x8(%rbp), %rax
movl 0x78(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x3b6c
movq -0x8(%rbp), %rdi
callq 0x3890
movzbl %al, %eax
movl %eax, -0x18(%rbp)
jmp 0x3b76
movl $0xff, %eax
movl %eax, -0x18(%rbp)
jmp 0x3b76
movl -0x18(%rbp), %eax
movb %al, -0xb(%rbp)
movq -0x8(%rbp), %rax
movl 0x1f0(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x38a0
movb %al, %cl
movl -0x1c(%rbp), %eax
movzbl %cl, %ecx
orl %ecx, %eax
movzbl -0xb(%rbp), %ecx
andl %ecx, %eax
movzbl -0xa(%rbp), %ecx
andl %ecx, %eax
movzbl -0x9(%rbp), %ecx
andl %ecx, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x180(%rax)
movq -0x8(%rbp), %rax
movzwl 0x180(%rax), %esi
leaq 0x1d54(%rip), %rdi      # 0x5922
movb $0x0, %al
callq 0x2030
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x1d47(%rip), %rdi      # 0x593a
movb $0x0, %al
callq 0x2030
movq -0x8(%rbp), %rax
movl 0x1bc(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xec(%rax)
movq -0x8(%rbp), %rax
movl 0x1c0(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xf0(%rax)
movq -0x8(%rbp), %rax
movl 0x1c4(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xf4(%rax)
movq -0x8(%rbp), %rax
movl 0x1c8(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xf8(%rax)
movq -0x8(%rbp), %rax
movl 0x1cc(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xfc(%rax)
movq -0x8(%rbp), %rax
movl 0x1d0(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x100(%rax)
movq -0x8(%rbp), %rax
movl 0x1d4(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x104(%rax)
movq -0x8(%rbp), %rax
movl 0x1d8(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x108(%rax)
movq -0x8(%rbp), %rax
movl 0x1dc(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10c(%rax)
movq -0x8(%rbp), %rax
movl 0x1e0(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x110(%rax)
movq -0x8(%rbp), %rax
movl 0x1e4(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x114(%rax)
movq -0x8(%rbp), %rdi
callq 0x2e30
movq -0x8(%rbp), %rdi
callq 0x2f00
movq -0x8(%rbp), %rax
cmpl $0x3, 0x2c(%rax)
jne 0x3d0a
movq -0x8(%rbp), %rax
movzwl 0xa8(%rax), %ecx
andl $0x1, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x230(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x3d4f
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %esi
shll $0x2, %esi
movq -0x8(%rbp), %rax
movl 0x240(%rax), %eax
shll %eax
orl %eax, %esi
movq -0x8(%rbp), %rax
orl 0x244(%rax), %esi
movq -0x8(%rbp), %rax
movzwl 0x218(%rax), %edx
leaq 0x1bf6(%rip), %rdi      # 0x593e
movb $0x0, %al
callq 0x2030
movq -0x8(%rbp), %rax
movw 0x218(%rax), %cx
movq -0x8(%rbp), %rax
movw %cx, 0xa0(%rax)
movq -0x8(%rbp), %rax
movl 0x1b4(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xe4(%rax)
movq -0x8(%rbp), %rax
movl 0x1b8(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xe8(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0xa0, %rsi
movl $0xa0, %edx
callq 0x2060
movq -0x8(%rbp), %rdi
callq 0x3050
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x1b7a(%rip), %rdi      # 0x594d
movb $0x0, %al
callq 0x2030
movq -0x8(%rbp), %rax
movl 0x188(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xb8(%rax)
movq -0x8(%rbp), %rax
movl 0x18c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xbc(%rax)
movq -0x8(%rbp), %rax
movl 0x190(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc0(%rax)
movq -0x8(%rbp), %rax
movl 0x194(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc4(%rax)
movq -0x8(%rbp), %rax
movl 0x198(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc8(%rax)
movq -0x8(%rbp), %rax
movl 0x19c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xcc(%rax)
movq -0x8(%rbp), %rax
movl 0x1a0(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xd0(%rax)
movq -0x8(%rbp), %rax
movl 0x1a4(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xd4(%rax)
movq -0x8(%rbp), %rax
movl 0x1a8(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xd8(%rax)
movq -0x8(%rbp), %rax
movl 0x1ac(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xdc(%rax)
movq -0x8(%rbp), %rax
movl 0x1b0(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xe0(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0xa0, %rsi
movl $0xa0, %edx
callq 0x2060
movq -0x8(%rbp), %rdi
callq 0x3050
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x1a5e(%rip), %rdi      # 0x5951
movb $0x0, %al
callq 0x2030
movq -0x8(%rbp), %rdi
callq 0x3ae0
movq -0x8(%rbp), %rax
movw 0x180(%rax), %ax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xb6(%rax)
movq -0x8(%rbp), %rax
cmpl $0x7, 0x5c(%rax)
jne 0x3f32
leaq 0x1a2a(%rip), %rdi      # 0x5955
movb $0x0, %al
callq 0x2030
movq -0x8(%rbp), %rax
cmpl $0x6, 0x60(%rax)
jne 0x3f4a
leaq 0x1a20(%rip), %rdi      # 0x5963
movb $0x0, %al
callq 0x2030
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0xa0, %rsi
movl $0xa0, %edx
callq 0x2060
movq -0x8(%rbp), %rdi
callq 0x3050
movq -0x8(%rbp), %rdi
callq 0x37d0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x258, %edx            # imm = 0x258
callq 0x2050
movq -0x8(%rbp), %rax
movl $0x0, 0x248(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x234(%rax)
movq -0x8(%rbp), %rdi
addq $0xa0, %rdi
addq $0x18, %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x2050
movq -0x8(%rbp), %rdi
callq 0x4020
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0xa0, %rsi
movl $0xa0, %edx
callq 0x2060
movq -0x8(%rbp), %rdi
callq 0x37d0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw $0x29c, 0xa4(%rax)      # imm = 0x29C
movq -0x8(%rbp), %rax
movw $0x8d1, 0xa8(%rax)      # imm = 0x8D1
movq -0x8(%rbp), %rax
movl $0x949b, 0x254(%rax)    # imm = 0x949B
movq -0x8(%rbp), %rax
movw $0xa6d1, 0x24c(%rax)    # imm = 0xA6D1
movl $0x0, -0xc(%rbp)
cmpl $0x3, -0xc(%rbp)
jge 0x41b0
movq -0x8(%rbp), %rdi
callq 0x3be0
movq -0x8(%rbp), %rdi
callq 0x22f0
movq -0x8(%rbp), %rdi
callq 0x3dc0
movq -0x8(%rbp), %rdi
callq 0x22f0
movq -0x8(%rbp), %rax
cmpl $0x1, 0x4c(%rax)
jne 0x415e
leaq 0x1828(%rip), %rdi      # 0x597f
movb $0x0, %al
callq 0x2030
movq -0x8(%rbp), %rdi
callq 0x3ee0
movq -0x8(%rbp), %rdi
callq 0x22f0
movq -0x8(%rbp), %rdi
callq 0x3f80
movq -0x8(%rbp), %rdi
callq 0x22f0
movq -0x8(%rbp), %rdi
callq 0x3fd0
movq -0x8(%rbp), %rdi
callq 0x22f0
leaq 0x17f1(%rip), %rdi      # 0x598c
movb $0x0, %al
callq 0x2030
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4118
movq -0x8(%rbp), %rdi
callq 0x3be0
movq -0x8(%rbp), %rdi
callq 0x22f0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/u_kb11a.c
// Function: main
int
main()
{
	KB11A *kb;
	kb = malloc(sizeof(KB11A));

	power(kb);
	test(kb);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movl $0x258, %edi            # imm = 0x258
callq 0x2070
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4040
movq -0x10(%rbp), %rdi
callq 0x40d0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
subq $0xc0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %eax
incl %eax
movq %rsp, %rcx
movq %rcx, -0x18(%rbp)
movq %rax, %rcx
shlq $0x8, %rcx
subq %rax, %rcx
addq $0xf, %rcx
movabsq $0x1fffffffff0, %rdx    # imm = 0x1FFFFFFFFF0
andq %rdx, %rcx
movq %rsp, %rdx
subq %rcx, %rdx
movq %rdx, -0xc0(%rbp)
movq %rdx, %rsp
movq %rax, -0x20(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x11c0
movq -0xc0(%rbp), %rdi
addq $0xff, %rdi
xorl %esi, %esi
callq 0x1070
cmpl $0x0, %eax
jne 0x14a4
movq -0xc0(%rbp), %rdi
addq $0xff, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x1050
cmpl $0x0, %eax
jl 0x1496
movl -0x98(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x1488
movq -0xc0(%rbp), %rdi
addq $0xff, %rdi
leaq 0xba0(%rip), %rsi       # 0x2004
callq 0x1080
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rdi
movq 0x2b62(%rip), %rax      # 0x3fe0
movq (%rax), %rsi
callq 0x1360
jmp 0x1494
leaq 0xb77(%rip), %rdi       # 0x2006
callq 0x1090
jmp 0x14a2
leaq 0xb72(%rip), %rdi       # 0x200f
callq 0x1090
jmp 0x14b0
leaq 0xb71(%rip), %rdi       # 0x201c
callq 0x1090
movl $0x0, -0x4(%rbp)
movq -0x18(%rbp), %rax
movq %rax, %rsp
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/DeforaOS[P]libSystem/tests/array.c
// Function: main
int main(void)
{
	int ret;
	intArray * array;

	if((array = array_new(SIZE_MAX)) != NULL)
		return 2;
	if((array = intarray_new()) == NULL)
		return 3;
	if((ret = _test(array)) != 0)
		error_print(PROGNAME);
	array_delete(array);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movq $-0x1, %rdi
callq 0x10d0
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x122e
movl $0x2, -0x4(%rbp)
jmp 0x1272
callq 0x1280
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0x1246
movl $0x3, -0x4(%rbp)
jmp 0x1272
movq -0x10(%rbp), %rdi
callq 0x1290
movl %eax, -0x8(%rbp)
cmpl $0x0, %eax
je 0x1263
leaq 0xda6(%rip), %rdi       # 0x2004
callq 0x10e0
movq -0x10(%rbp), %rdi
callq 0x1080
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x2, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x36b0
movl %eax, -0x44(%rbp)
callq 0x3470
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x39a1
movq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rcx
movb $0x1, %al
cmpl $0x0, (%rcx)
movb %al, -0x5d(%rbp)
jne 0x38b9
movq -0x58(%rbp), %rax
cmpq $0x0, 0x8(%rax)
setne %al
movb %al, -0x5d(%rbp)
movb -0x5d(%rbp), %al
testb $0x1, %al
jne 0x38c5
jmp 0x399f
leaq -0x40(%rbp), %rdi
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x30d0
movl -0x44(%rbp), %edi
movl $0x8927, %esi           # imm = 0x8927
leaq -0x40(%rbp), %rdx
movb $0x0, %al
callq 0x3270
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x398c
movsbl -0x2e(%rbp), %eax
cmpl $0x0, %eax
jne 0x392d
movsbl -0x2d(%rbp), %eax
cmpl $0x0, %eax
jne 0x392d
movsbl -0x2c(%rbp), %eax
cmpl $0x0, %eax
jne 0x392d
movsbl -0x2b(%rbp), %eax
cmpl $0x0, %eax
jne 0x392d
movsbl -0x2a(%rbp), %eax
cmpl $0x0, %eax
jne 0x392d
movsbl -0x29(%rbp), %eax
cmpl $0x0, %eax
jne 0x392d
jmp 0x398e
movl $0x0, -0x5c(%rbp)
xorl %eax, %eax
cmpl $0x6, -0x5c(%rbp)
movb %al, -0x5e(%rbp)
jge 0x394d
movl -0x5c(%rbp), %eax
shll %eax
cmpl -0x14(%rbp), %eax
setl %al
movb %al, -0x5e(%rbp)
movb -0x5e(%rbp), %al
testb $0x1, %al
jne 0x3956
jmp 0x3986
movq -0x10(%rbp), %rdi
movl -0x5c(%rbp), %eax
shll %eax
cltq
addq %rax, %rdi
movslq -0x5c(%rbp), %rax
movzbl -0x2e(%rbp,%rax), %edx
leaq 0x1dc79(%rip), %rsi     # 0x215ed
movb $0x0, %al
callq 0x35e0
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x3934
movb $0x1, -0x1(%rbp)
jmp 0x39a5
jmp 0x398e
movq -0x58(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x58(%rbp)
jmp 0x389c
jmp 0x39a1
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq 0x235ea(%rip), %rax     # 0x26fb8
movq (%rax), %rdi
callq 0x33e0
movq -0x18(%rbp), %rdi
movq %rax, %rsi
movslq -0xc(%rbp), %rdx
callq 0x30a0
movq -0x8(%rbp), %rdi
callq 0x3180
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x3a60
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x10(%rbp)
movslq %ecx, %rcx
movb $0x5f, (%rax,%rcx)
movq -0x8(%rbp), %rdi
movslq -0x10(%rbp), %rax
addq %rax, %rdi
movl -0xc(%rbp), %esi
subl -0x10(%rbp), %esi
callq 0x3860
testb $0x1, %al
jne 0x3a5e
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %eax
subl -0x10(%rbp), %eax
movl %eax, -0x1c(%rbp)
callq 0x3130
movq -0x28(%rbp), %rdi
movl -0x1c(%rbp), %edx
movl %eax, %ecx
leaq 0x1b5ad(%rip), %rsi     # 0x1f004
movb $0x0, %al
callq 0x35e0
jmp 0x3a60
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, 0x238d9(%rip)     # 0x27370
je 0x3aa3
cmpq $0x0, 0x239d7(%rip)     # 0x27478
jne 0x3ac1
movq 0x23546(%rip), %rax     # 0x26ff0
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x1b551(%rip), %rsi     # 0x1f009
movb $0x0, %al
callq 0x3370
jmp 0x3b38
movzwl 0x239a8(%rip), %eax     # 0x27470
cmpl $0xffff, %eax           # imm = 0xFFFF
jl 0x3ada
movw $0x1, 0x23998(%rip)     # 0x27470
jmp 0x3aec
movw 0x2398f(%rip), %ax      # 0x27470
addw $0x1, %ax
movw %ax, 0x23984(%rip)      # 0x27470
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq 0x2399d(%rip), %rax     # 0x27498
movq %rax, -0x28(%rbp)
movw 0x2396a(%rip), %ax      # 0x27470
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3180
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %r8
movq %rax, %r9
movw -0x12(%rbp), %ax
xorl %ecx, %ecx
movzwl %ax, %edx
callq 0x17810
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq 0x23929(%rip), %rsi     # 0x27480
leaq 0x52(%rip), %rdx        # 0x3bb0
callq 0xc0a0
cmpq $0x0, %rax
jne 0x3b92
movq 0x23480(%rip), %rax     # 0x26ff0
movq (%rax), %rdi
movq 0x23906(%rip), %rdx     # 0x27480
leaq 0x1b4bc(%rip), %rsi     # 0x1f03d
movb $0x0, %al
callq 0x3370
movl $0x1, %edi
callq 0x35f0
movl $0x0, 0x237d4(%rip)     # 0x27370
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/unifi-motion.c
// Function: close_log
void close_log(FILE *log) {
  if (log != NULL) {
    fclose(log);
  } else if (_umHandles.logfile != NULL) {
    fclose(_umHandles.logfile);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x3d3e
movq -0x8(%rbp), %rdi
callq 0x3160
jmp 0x3d56
cmpq $0x0, 0x2391a(%rip)     # 0x27660
je 0x3d54
movq 0x23911(%rip), %rdi     # 0x27660
callq 0x3160
jmp 0x3d56
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
movq 0x23705(%rip), %rdi     # 0x27660
callq 0x3d20
movl 0x23702(%rip), %edi     # 0x27668
movl 0x23700(%rip), %esi     # 0x2766c
callq 0x3660
cmpl $0x1, 0x233f8(%rip)     # 0x27370
jne 0x3f90
cmpq $0x0, 0x234f6(%rip)     # 0x27478
je 0x3f90
movq 0x234ed(%rip), %rdi     # 0x27478
callq 0x17eb0
leaq 0x234e9(%rip), %rdi     # 0x27480
callq 0x1e000
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: cs_log_set_filter
void cs_log_set_filter(const char *str) {
  free(s_filter_pattern);
  if (str != NULL) {
    s_filter_pattern = strdup(str);
    s_filter_pattern_len = strlen(str);
  } else {
    s_filter_pattern = NULL;
    s_filter_pattern_len = 0;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x230a5(%rip), %rdi     # 0x276a8
callq 0x3050
cmpq $0x0, -0x8(%rbp)
je 0x4631
movq -0x8(%rbp), %rdi
callq 0x3640
movq %rax, 0x23089(%rip)     # 0x276a8
movq -0x8(%rbp), %rdi
callq 0x3180
movq %rax, 0x23081(%rip)     # 0x276b0
jmp 0x4647
movq $0x0, 0x2306c(%rip) # 0x276a8
movq $0x0, 0x23069(%rip) # 0x276b0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: cs_log_print_prefix
int cs_log_print_prefix(enum cs_log_level level, const char *func,
                        const char *filename) {
  char prefix[21];

  if (level > cs_log_threshold) return 0;
  if (s_filter_pattern != NULL &&
      mg_match_prefix(s_filter_pattern, s_filter_pattern_len, func) < 0 &&
      mg_match_prefix(s_filter_pattern, s_filter_pattern_len, filename) < 0) {
    return 0;
  }

  strncpy(prefix, func, 20);
  prefix[20] = '\0';
  if (cs_log_file == NULL) cs_log_file = stderr;
  cs_log_cur_msg_level = level;
  fprintf(cs_log_file, "%-20s ", prefix);
#if CS_LOG_ENABLE_TS_DIFF
  {
    double now = cs_time();
    fprintf(cs_log_file, "%7u ", (unsigned int) ((now - cs_log_ts) * 1000000));
    cs_log_ts = now;
  }
#endif
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl -0x8(%rbp), %eax
cmpl 0x2302c(%rip), %eax     # 0x27698
jle 0x467a
movl $0x0, -0x4(%rbp)
jmp 0x4723
cmpq $0x0, 0x23026(%rip)     # 0x276a8
je 0x46c9
movq 0x2301d(%rip), %rdi     # 0x276a8
movq 0x2301e(%rip), %rax     # 0x276b0
movl %eax, %esi
movq -0x10(%rbp), %rdx
callq 0x4730
cmpl $0x0, %eax
jge 0x46c9
movq 0x22fff(%rip), %rdi     # 0x276a8
movq 0x23000(%rip), %rax     # 0x276b0
movl %eax, %esi
movq -0x18(%rbp), %rdx
callq 0x4730
cmpl $0x0, %eax
jge 0x46c9
movl $0x0, -0x4(%rbp)
jmp 0x4723
leaq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x14, %edx
callq 0x30a0
movb $0x0, -0x1c(%rbp)
cmpq $0x0, 0x22fb9(%rip)     # 0x276a0
jne 0x46fa
movq 0x22900(%rip), %rax     # 0x26ff0
movq (%rax), %rax
movq %rax, 0x22fa6(%rip)     # 0x276a0
movl -0x8(%rbp), %eax
movl %eax, 0x22c7d(%rip)     # 0x27380
movq 0x22f96(%rip), %rdi     # 0x276a0
leaq -0x30(%rbp), %rdx
leaq 0x1ade3(%rip), %rsi     # 0x1f4f8
movb $0x0, %al
callq 0x3370
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_match_prefix
int mg_match_prefix(const char *pattern, int pattern_len, const char *str) {
  const struct mg_str pstr = {pattern, (size_t) pattern_len};
  struct mg_str s = {str, 0};
  if (str != NULL) s.len = strlen(str);
  return mg_match_prefix_n(pstr, s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movslq -0xc(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4777
movq -0x18(%rbp), %rdi
callq 0x3180
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0xa510
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: cs_log_printf
void cs_log_printf(const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  vfprintf(cs_log_file, fmt, ap);
  va_end(ap);
  fputc('\n', cs_log_file);
  fflush(cs_log_file);
  cs_log_cur_msg_level = LL_NONE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
testb %al, %al
je 0x47d5
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
movq %r9, -0xa8(%rbp)
movq %r8, -0xb0(%rbp)
movq %rcx, -0xb8(%rbp)
movq %rdx, -0xc0(%rbp)
movq %rsi, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
leaq -0xd0(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x30, -0x1c(%rbp)
movl $0x8, -0x20(%rbp)
movq 0x22e7c(%rip), %rdi     # 0x276a0
movq -0x8(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x3580
movq 0x22e68(%rip), %rsi     # 0x276a0
movl $0xa, %edi
callq 0x32d0
movq 0x22e57(%rip), %rdi     # 0x276a0
callq 0x3440
movl $0xffffffff, 0x22b28(%rip) # imm = 0xFFFFFFFF
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: cs_base64_update
void cs_base64_update(struct cs_base64_ctx *ctx, const char *str, size_t len) {
  const unsigned char *src = (const unsigned char *) str;
  size_t i;
  for (i = 0; i < len; i++) {
    ctx->chunk[ctx->chunk_size++] = src[i];
    if (ctx->chunk_size == 3) {
      cs_base64_emit_chunk(ctx);
      ctx->chunk_size = 0;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x4971
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rsi
movl 0xc(%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, 0xc(%rsi)
movslq %ecx, %rcx
movb %dl, 0x8(%rax,%rcx)
movq -0x8(%rbp), %rax
cmpl $0x3, 0xc(%rax)
jne 0x4961
movq -0x8(%rbp), %rdi
callq 0x4980
movq -0x8(%rbp), %rax
movl $0x0, 0xc(%rax)
jmp 0x4963
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x4914
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: cs_base64_emit_chunk
static void cs_base64_emit_chunk(struct cs_base64_ctx *ctx) {
  int a, b, c;

  a = ctx->chunk[0];
  b = ctx->chunk[1];
  c = ctx->chunk[2];

  cs_base64_emit_code(ctx, a >> 2);
  cs_base64_emit_code(ctx, ((a & 3) << 4) | (b >> 4));
  if (ctx->chunk_size > 1) {
    cs_base64_emit_code(ctx, (b & 15) << 2 | (c >> 6));
  }
  if (ctx->chunk_size > 2) {
    cs_base64_emit_code(ctx, c & 63);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x8(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x9(%rax), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzbl 0xa(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
sarl $0x2, %esi
callq 0x19760
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
andl $0x3, %esi
shll $0x4, %esi
movl -0x10(%rbp), %eax
sarl $0x4, %eax
orl %eax, %esi
callq 0x19760
movq -0x8(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jle 0x49fa
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
andl $0xf, %esi
shll $0x2, %esi
movl -0x14(%rbp), %eax
sarl $0x6, %eax
orl %eax, %esi
callq 0x19760
movq -0x8(%rbp), %rax
cmpl $0x2, 0xc(%rax)
jle 0x4a13
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
andl $0x3f, %esi
callq 0x19760
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: cs_base64_finish
void cs_base64_finish(struct cs_base64_ctx *ctx) {
  if (ctx->chunk_size > 0) {
    int i;
    memset(&ctx->chunk[ctx->chunk_size], 0, 3 - ctx->chunk_size);
    cs_base64_emit_chunk(ctx);
    for (i = 0; i < (3 - ctx->chunk_size); i++) {
      ctx->b64_putc('=', ctx->user_data);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jle 0x4aa5
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x8(%rbp), %rax
movslq 0xc(%rax), %rax
addq %rax, %rdi
movq -0x8(%rbp), %rcx
movl $0x3, %eax
subl 0xc(%rcx), %eax
movslq %eax, %rdx
xorl %esi, %esi
callq 0x3260
movq -0x8(%rbp), %rdi
callq 0x4980
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rdx
movl $0x3, %ecx
subl 0xc(%rdx), %ecx
cmpl %ecx, %eax
jge 0x4aa3
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rsi
movl $0x3d, %edi
callq *%rax
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4a6f
jmp 0x4aa5
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: cs_base64_decode
int cs_base64_decode(const unsigned char *s, int len, char *dst, int *dec_len) {
  unsigned char a, b, c, d;
  int orig_len = len;
  char *orig_dst = dst;
  while (len >= 4 && (a = from_b64(s[0])) != 255 &&
         (b = from_b64(s[1])) != 255 && (c = from_b64(s[2])) != 255 &&
         (d = from_b64(s[3])) != 255) {
    s += 4;
    len -= 4;
    if (a == 200 || b == 200) break; /* '=' can't be there */
    *dst++ = a << 2 | b >> 4;
    if (c == 200) break;
    *dst++ = b << 4 | c >> 2;
    if (d == 200) break;
    *dst++ = c << 6 | d;
  }
  *dst = 0;
  if (dec_len != NULL) *dec_len = (dst - orig_dst);
  return orig_len - len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
xorl %eax, %eax
cmpl $0x4, -0xc(%rbp)
movb %al, -0x31(%rbp)
jl 0x4efd
movq -0x8(%rbp), %rax
movzbl (%rax), %edi
callq 0x4ff0
movb %al, -0x21(%rbp)
movzbl %al, %ecx
xorl %eax, %eax
cmpl $0xff, %ecx
movb %al, -0x31(%rbp)
je 0x4efd
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %edi
callq 0x4ff0
movb %al, -0x22(%rbp)
movzbl %al, %ecx
xorl %eax, %eax
cmpl $0xff, %ecx
movb %al, -0x31(%rbp)
je 0x4efd
movq -0x8(%rbp), %rax
movzbl 0x2(%rax), %edi
callq 0x4ff0
movb %al, -0x23(%rbp)
movzbl %al, %ecx
xorl %eax, %eax
cmpl $0xff, %ecx
movb %al, -0x31(%rbp)
je 0x4efd
movq -0x8(%rbp), %rax
movzbl 0x3(%rax), %edi
callq 0x4ff0
movb %al, -0x24(%rbp)
movzbl %al, %eax
cmpl $0xff, %eax
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x4f09
jmp 0x4fbe
movq -0x8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x8(%rbp)
movl -0xc(%rbp), %eax
subl $0x4, %eax
movl %eax, -0xc(%rbp)
movzbl -0x21(%rbp), %eax
cmpl $0xc8, %eax
je 0x4f34
movzbl -0x22(%rbp), %eax
cmpl $0xc8, %eax
jne 0x4f39
jmp 0x4fbe
movzbl -0x21(%rbp), %eax
shll $0x2, %eax
movzbl -0x22(%rbp), %ecx
sarl $0x4, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
movzbl -0x23(%rbp), %eax
cmpl $0xc8, %eax
jne 0x4f69
jmp 0x4fbe
movzbl -0x22(%rbp), %eax
shll $0x4, %eax
movzbl -0x23(%rbp), %ecx
sarl $0x2, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
movzbl -0x24(%rbp), %eax
cmpl $0xc8, %eax
jne 0x4f99
jmp 0x4fbe
movzbl -0x23(%rbp), %eax
shll $0x6, %eax
movzbl -0x24(%rbp), %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
jmp 0x4e75
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x4fdf
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %eax
subl -0xc(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: cs_time
double cs_time(void) {
  double now;
#ifndef _WIN32
  struct timeval tv;
  if (gettimeofday(&tv, NULL /* tz */) != 0) return 0;
  now = (double) tv.tv_sec + (((double) tv.tv_usec) / 1000000.0);
#else
  SYSTEMTIME sysnow;
  FILETIME ftime;
  GetLocalTime(&sysnow);
  SystemTimeToFileTime(&sysnow, &ftime);
  /*
   * 1. VC 6.0 doesn't support conversion uint64 -> double, so, using int64
   * This should not cause a problems in this (21th) century
   * 2. Windows FILETIME is a number of 100-nanosecond intervals since January
   * 1, 1601 while time_t is a number of _seconds_ since January 1, 1970 UTC,
   * thus, we need to convert to seconds and adjust amount (subtract 11644473600
   * seconds)
   */
  now = (double) (((int64_t) ftime.dwLowDateTime +
                   ((int64_t) ftime.dwHighDateTime << 32)) /
                  10000000.0) -
        11644473600;
#endif /* _WIN32 */
  return now;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3220
cmpl $0x0, %eax
je 0x5034
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x505f
cvtsi2sdq -0x20(%rbp), %xmm0
cvtsi2sdq -0x18(%rbp), %xmm1
movsd 0x1a2a8(%rip), %xmm2    # 0x1f2f0
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)