// File: /workspace/github_c_makefile_star2_O0/aligrudi[P]gpss/gpss.c
// Function: gpss_linecover_next
static int gpss_linecover_next(int *P, int *lnmk)
{
	int *lncovers;
	int i, j;
	int lnbest = -1;
	lncovers = calloc(ln_n, sizeof(lncovers[0]));
	for (i = 0; i < pt_n; i++) {
		int covered = 0;
		for (j = 0; j < pt_cnt[i]; j++)
			if (lnmk[pt_ln[i][j]])
				covered++;
		if (!covered && pt_cnt[i] == 1) {	/* point covered by only one line */
			for (j = 0; j < pt_cnt[i]; j++)
				if (!lnmk[pt_ln[i][j]])
					break;
			return pt_ln[i][j];
		}
		if (!covered)
			for (j = 0; j < pt_cnt[i]; j++)
				lncovers[pt_ln[i][j]]++;
	}
	for (i = 0; i < ln_n; i++)
		if (lncovers[i] > 0 && (lnbest < 0 || lncovers[i] >= lncovers[lnbest]))
			lnbest = i;
	free(lncovers);
	return lnbest;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movslq 0x31fe(%rip), %rdi      # 0x506c
movl $0x4, %esi
callq 0x1070
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl 0x31dc(%rip), %eax      # 0x5068
jge 0x1fca
movl $0x0, -0x30(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq 0x31de(%rip), %rcx      # 0x5088
movslq -0x24(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x1eea
movq -0x18(%rbp), %rax
movq 0x31c2(%rip), %rcx      # 0x5080
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x28(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x1edd
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1edf
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1ea0
cmpl $0x0, -0x30(%rbp)
jne 0x1f69
movq 0x3191(%rip), %rax      # 0x5088
movslq -0x24(%rbp), %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x1f69
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq 0x3176(%rip), %rcx      # 0x5088
movslq -0x24(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x1f4b
movq -0x18(%rbp), %rax
movq 0x315a(%rip), %rcx      # 0x5080
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x28(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x1f3e
jmp 0x1f4b
jmp 0x1f40
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1f08
movq 0x312e(%rip), %rax      # 0x5080
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4(%rbp)
jmp 0x202a
cmpl $0x0, -0x30(%rbp)
jne 0x1fba
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq 0x3108(%rip), %rcx      # 0x5088
movslq -0x24(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x1fb8
movq -0x20(%rbp), %rax
movq 0x30ec(%rip), %rcx      # 0x5080
movslq -0x24(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x28(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1f76
jmp 0x1fba
jmp 0x1fbc
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1e83
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl 0x3092(%rip), %eax      # 0x506c
jge 0x201b
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0x200e
cmpl $0x0, -0x2c(%rbp)
jl 0x2008
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x20(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jl 0x200e
movl -0x24(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x2010
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1fd1
movq -0x20(%rbp), %rdi
callq 0x1030
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)