// File: /workspace/github_c_makefile_star2_O0/aligrudi[P]gpss/gpss.c
// Function: gpss_iset
static int gpss_iset(int *filt, int *S, int *P)
{
	/* mark[i]: 0 = not selected; 1 = selected; 2 = filtered or covered */
	char *mark = malloc(pt_n * sizeof(mark[0]));
	int S_n = 0;
	int i, j, k;
	for (i = 0; i < pt_n; i++)
		mark[i] = filt[P[i]] ? 2 : 0;
	for (i = 0; i < pt_n; i++)
		if (!mark[i] && pt_cnt[i] == 0)
			mark[i] = 1;
	for (i = 0; i < pt_n; i++) {
		int p = iset_next(P, mark);
		if (p >= 0) {
			mark[p] = 1;
			for (j = 0; j < pt_cnt[p]; j++) {
				int e = pt_ln[p][j];
				for (k = 0; k < ln_cnt[e]; k++)
					if (!mark[ln[e][k]])
						mark[ln[e][k]] = 2;
			}
		}
	}
	for (i = 0; i < pt_n; i++)
		if (mark[i] == 1)
			S[S_n++] = i;
	free(mark);
	return S_n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movslq 0x273d(%rip), %rdi      # 0x5068
shlq $0x0, %rdi
callq 0x1080
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl 0x2719(%rip), %eax      # 0x5068
jge 0x2989
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq -0x28(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edx
xorl %eax, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movb %al, %dl
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2946
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl 0x26cf(%rip), %eax      # 0x5068
jge 0x29d3
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
jne 0x29c6
movq 0x26d8(%rip), %rax      # 0x5088
movslq -0x28(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x29c6
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0x29c8
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2990
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl 0x2685(%rip), %eax      # 0x5068
jge 0x2acf
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2b30
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0x2abf
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
movb $0x1, (%rax,%rcx)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq 0x2668(%rip), %rcx      # 0x5088
movslq -0x34(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2abd
movq 0x264c(%rip), %rax      # 0x5080
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq 0x2621(%rip), %rcx      # 0x5078
movslq -0x38(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2aad
movq -0x20(%rbp), %rax
movq 0x2605(%rip), %rcx      # 0x5070
movslq -0x38(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x30(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpb $0x0, (%rax,%rcx)
jne 0x2aa0
movq -0x20(%rbp), %rax
movq 0x25e4(%rip), %rcx      # 0x5070
movslq -0x38(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x30(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movb $0x2, (%rax,%rcx)
jmp 0x2aa2
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2a4d
jmp 0x2aaf
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2a16
jmp 0x2abf
jmp 0x2ac1
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x29da
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl 0x2589(%rip), %eax      # 0x5068
jge 0x2b17
movq -0x20(%rbp), %rax
movslq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x1, %eax
jne 0x2b0a
movl -0x28(%rbp), %edx
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x24(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x2b0c
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2ad6
movq -0x20(%rbp), %rdi
callq 0x1030
movl -0x24(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)