// File: /workspace/github_c_makefile_star2_O0/lh3[P]bgt/bgt.c
// Function: bgtm_cal_info
void bgtm_cal_info(const bgtm_t *bm, bgt_info_t *ss)
{
	int32_t cnt[4], i;
	memset(cnt, 0, 4 * 4);
	ss->n_groups = bm->n_groups;
	if (bm->n_groups > 1) {
		int32_t j, gcnt[BGT_MAX_GROUPS][4];
		memset(gcnt, 0, 4 * BGT_MAX_GROUPS * 4);
		for (i = 0; i < bm->n_out<<1; ++i)
			++gcnt[bm->group[i>>1]-1][bm->a[1][i]<<1 | bm->a[0][i]];
		for (i = 0; i < bm->n_groups; ++i) {
			ss->gan[i] = gcnt[i][0] + gcnt[i][1] + gcnt[i][3];
			ss->gac[i][0] = gcnt[i][1];
			ss->gac[i][1] = gcnt[i][3];
			for (j = 0; j < 4; ++j) cnt[j] += gcnt[i][j];
		}
	} else {
		for (i = 0; i < bm->n_out<<1; ++i)
			++cnt[bm->a[1][i]<<1 | bm->a[0][i]];
	}
	ss->an = cnt[0] + cnt[1] + cnt[3];
	ss->ac[0] = cnt[1], ss->ac[1] = cnt[3];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x21e0
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jle 0x202b4
leaq -0x230(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x21e0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0x201bc
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x24(%rbp), %ecx
sarl %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %ecx
leaq -0x230(%rbp), %rax
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x8(%rbp), %rcx
movq 0x60(%rcx), %rcx
movslq -0x24(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
shll %ecx
movq -0x8(%rbp), %rdx
movq 0x58(%rdx), %rdx
movslq -0x24(%rbp), %rsi
movzbl (%rdx,%rsi), %edx
orl %edx, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x20149
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x202b2
movslq -0x24(%rbp), %rcx
leaq -0x230(%rbp), %rax
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %edx
movslq -0x24(%rbp), %rcx
leaq -0x230(%rbp), %rax
shlq $0x4, %rcx
addq %rcx, %rax
addl 0x4(%rax), %edx
movslq -0x24(%rbp), %rcx
leaq -0x230(%rbp), %rax
shlq $0x4, %rcx
addq %rcx, %rax
addl 0xc(%rax), %edx
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, 0x10(%rax,%rcx,4)
movslq -0x24(%rbp), %rcx
leaq -0x230(%rbp), %rax
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %edx
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, 0x90(%rax,%rcx,8)
movslq -0x24(%rbp), %rcx
leaq -0x230(%rbp), %rax
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %edx
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl %edx, 0x94(%rax,%rcx,8)
movl $0x0, -0x28(%rbp)
cmpl $0x4, -0x28(%rbp)
jge 0x202a2
movslq -0x24(%rbp), %rcx
leaq -0x230(%rbp), %rax
shlq $0x4, %rcx
addq %rcx, %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movslq -0x28(%rbp), %rax
addl -0x20(%rbp,%rax,4), %ecx
movl %ecx, -0x20(%rbp,%rax,4)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2026c
jmp 0x202a4
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x201c3
jmp 0x20309
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0x20307
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x24(%rbp), %rcx
movzbl (%rax,%rcx), %eax
shll %eax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
movslq -0x24(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
orl %ecx, %eax
cltq
movl -0x20(%rbp,%rax,4), %ecx
addl $0x1, %ecx
movl %ecx, -0x20(%rbp,%rax,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x202bb
jmp 0x20309
movl -0x20(%rbp), %ecx
addl -0x1c(%rbp), %ecx
addl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)