// File: /workspace/github_c_makefile_star2_O0/lh3[P]bgt/pbwt.c
// Function: pbc_dec_core
void pbc_dec_core(int m, const int32_t *S0, const uint8_t *u, int32_t *S, uint8_t *a)
{
	const uint8_t *q;
	int32_t *p[2], n1, s;
	for (q = u, n1 = 0; *q; ++q) // count the number of 1 bits
		if (*q&1) n1 += pbr_tbl[*q>>1];
	if (n1 == 0 || n1 == m) {
		memcpy(S, S0, m * 4);
		memset(a, (n1 == m), m);
	} else {
		p[0] = S, p[1] = p[0] + (m - n1);
		memset(a, 0, m);
		for (q = u, s = 0; *q; ++q) {
			int i, l = pbr_tbl[*q>>1], b = *q&1; // $l is the run length
			const int32_t *t = &S0[s];
			if (b) for (i = 0; i < l; ++i) a[t[i]] = b;
			memcpy(p[b], t, l * 4);
			p[b] += l;
			s += l;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
je 0x1a8be
movq -0x30(%rbp), %rax
movzbl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1a8ae
movq -0x30(%rbp), %rax
movzbl (%rax), %eax
sarl %eax
movslq %eax, %rcx
leaq 0x13b3b(%rip), %rax     # 0x2e3e0
movl (%rax,%rcx,4), %eax
addl -0x44(%rbp), %eax
movl %eax, -0x44(%rbp)
jmp 0x1a8b0
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x1a87a
cmpl $0x0, -0x44(%rbp)
je 0x1a8cc
movl -0x44(%rbp), %eax
cmpl -0x4(%rbp), %eax
jne 0x1a905
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x4(%rbp), %eax
shll $0x2, %eax
movslq %eax, %rdx
callq 0x2290
movq -0x28(%rbp), %rdi
movl -0x44(%rbp), %eax
cmpl -0x4(%rbp), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
movslq -0x4(%rbp), %rdx
movzbl %al, %esi
callq 0x21e0
jmp 0x1aa15
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl -0x4(%rbp), %ecx
subl -0x44(%rbp), %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
movslq -0x4(%rbp), %rdx
xorl %esi, %esi
callq 0x21e0
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
je 0x1aa13
movq -0x30(%rbp), %rax
movzbl (%rax), %eax
sarl %eax
movslq %eax, %rcx
leaq 0x13a7d(%rip), %rax     # 0x2e3e0
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
movq -0x30(%rbp), %rax
movzbl (%rax), %eax
andl $0x1, %eax
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
cmpl $0x0, -0x54(%rbp)
je 0x1a9c3
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jge 0x1a9c1
movl -0x54(%rbp), %eax
movb %al, %dl
movq -0x28(%rbp), %rax
movq -0x60(%rbp), %rcx
movslq -0x4c(%rbp), %rsi
movslq (%rcx,%rsi,4), %rcx
movb %dl, (%rax,%rcx)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1a996
jmp 0x1a9c3
movslq -0x54(%rbp), %rax
movq -0x40(%rbp,%rax,8), %rdi
movq -0x60(%rbp), %rsi
movl -0x50(%rbp), %eax
shll $0x2, %eax
movslq %eax, %rdx
callq 0x2290
movl -0x50(%rbp), %edx
movslq -0x54(%rbp), %rax
movq -0x40(%rbp,%rax,8), %rcx
movslq %edx, %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
movq %rcx, -0x40(%rbp,%rax,8)
movl -0x50(%rbp), %eax
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x1a943
jmp 0x1aa15
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)