// File: /workspace/github_c_makefile_star2_O3/josch[P]stride/elem.c
// Function: FullElement
int FullElement(char *Asn1, char *Asn2, char *Asn3, int Length, char SecStrType, int ElemLength,
		 char EditChar, int *YYN, int *NYY, int *YNN, int *NNY)
{

  register int i, j, Count1, Count2, Count3;
  int Beg, ElLength;

  *YYN = 0;
  *NYY = 0;
  *YNN = 0;
  *NNY = 0;

  if( ElemLength >= Length )
    return(0);

  ElLength = ElemLength-1;
  Count1 = 0;
  Count2 = 0;
  Count3 = 0;

  Beg = -1;
  
  for( i=1; i<Length; i++ ) {
    if( ( i == 0 && 
	  ( Asn1[i] == SecStrType && Asn2[i] == SecStrType && Asn3[i] == SecStrType) ||
          ( Asn1[i] != SecStrType && Asn2[i] != SecStrType && Asn3[i] != SecStrType) )
       ||
        ( i  > 0 && 
	  ( Asn1[i] != Asn1[i-1] || Asn2[i] != Asn2[i-1] || Asn3[i] != Asn3[i-1] ) )
       ||
        i == Length-1 ) {
      
      if( Count1 >= ElLength && Count2 >= ElLength && Count3 <  ElLength ) 
	(*YYN)++;
      else
      if( Count1 <  ElLength && Count2 >= ElLength && Count3 >= ElLength ) 
	(*NYY)++;
      else
      if( Count1 >= ElLength && Count2 <  ElLength && Count3 <  ElLength ) 
	(*YNN)++;
      else
      if( Count1 <  ElLength && Count2 <  ElLength && Count3 >= ElLength ) 
	(*NNY)++;
      
/*       if( Count1 >= ElLength || Count2 >= ElLength || Count3 >= ElLength ) {
 * 	for( j=Beg-1; j<i; j++ ) {
 * 	  Asn1[j] = 'X';
 * 	  Asn2[j] = 'X';
 * 	  Asn3[j] = 'X';
 * 	}
 *       }
 * 
 */
      if( Count1 >= ElLength && ( Count2 < ElLength || Count3 < ElLength ) )
	for( j=Beg-1; j<i; j++ )
	  Asn1[j] = EditChar;

      if( Count2 >= ElLength && ( Count1 < ElLength || Count3 < ElLength ) )
	for( j=Beg-1; j<i; j++ )
	  Asn2[j] = EditChar;

      if( Count3 >= ElLength && ( Count1 < ElLength || Count2 < ElLength ) )
	for( j=Beg-1; j<i; j++ )
	  Asn3[j] = EditChar;

      Count1 = 0;
      Count2 = 0;
      Count3 = 0;
      Beg = -1;
      
    }
    else {
      if( Asn1[i] == SecStrType ) Count1++;
      if( Asn2[i] == SecStrType ) Count2++;
      if( Asn3[i] == SecStrType ) Count3++;
      if( Beg == -1 && (Count1 == 1 || Count2 == 1 || Count3 == 1) ) Beg = i;
    }
  }	

  CorrectAsn(Asn1,Length,SecStrType,EditChar,ElLength);
  CorrectAsn(Asn2,Length,SecStrType,EditChar,ElLength);
  CorrectAsn(Asn3,Length,SecStrType,EditChar,ElLength);

  return( (*YYN) * (*NYY) * (*YNN) * (*NNY) );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r9d, %ebx
movq %rdx, 0x10(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, 0x20(%rsp)
movq 0xa0(%rsp), %r9
movq 0x98(%rsp), %rdx
movq 0x90(%rsp), %rdi
movq 0x88(%rsp), %rsi
xorl %eax, %eax
movl %eax, (%rsi)
movl %eax, (%rdi)
movl %eax, (%rdx)
movl %eax, (%r9)
cmpl %ecx, %ebx
jge 0x16b46
decl %ebx
movq %rcx, 0x30(%rsp)
cmpl $0x2, %ecx
jl 0x16aca
movq 0x30(%rsp), %rax
leal -0x1(%rax), %ecx
movq %rcx, 0x38(%rsp)
movl %eax, %eax
movq %rax, 0x40(%rsp)
xorl %r9d, %r9d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, (%rsp)
movl $0x1, %r14d
xorl %r10d, %r10d
xorl %r13d, %r13d
movl %r8d, 0x8(%rsp)
movq 0x20(%rsp), %rax
movb (%rax,%r14), %al
cmpb %r8b, %al
je 0x16870
movq 0x18(%rsp), %rcx
cmpb %r8b, (%rcx,%r14)
je 0x16870
movq 0x10(%rsp), %rcx
cmpb %r8b, (%rcx,%r14)
jne 0x168b4
movq 0x20(%rsp), %rcx
cmpb -0x1(%rcx,%r14), %al
jne 0x168b4
movq 0x18(%rsp), %rcx
movb (%rcx,%r14), %dl
cmpb -0x1(%rcx,%r14), %dl
jne 0x168b4
movq 0x10(%rsp), %rsi
movb (%rsi,%r14), %cl
cmpb -0x1(%rsi,%r14), %cl
setne %sil
cmpq %r14, 0x38(%rsp)
sete %dil
orb %sil, %dil
cmpb $0x1, %dil
jne 0x16a72
cmpl %ebx, %r13d
setl %al
cmpl %ebx, %r10d
setl %r12b
orb %al, %r12b
movslq (%rsp), %rax
jne 0x1694f
cmpl %ebx, %r9d
jge 0x1694f
cmpl %ebx, %r13d
setge %cl
movq 0x88(%rsp), %rdx
incl (%rdx)
cmpl %ebx, %r9d
setl %dl
cmpl %ebx, %r10d
setl %sil
movq (%rsp), %rdi
decl %edi
cmpq %rax, %r14
setge %bpl
testb %cl, %cl
je 0x16985
orb %dl, %sil
je 0x16985
cmpq %rax, %r14
jl 0x16985
movl %edi, 0xc(%rsp)
movslq 0xc(%rsp), %rdi
addq 0x20(%rsp), %rdi
movl %r14d, %edx
subl (%rsp), %edx
incq %rdx
movzbl 0x80(%rsp), %esi
movl %r13d, 0x2c(%rsp)
movl %r9d, %r13d
movl %r10d, %r15d
callq 0x20f0
movl 0xc(%rsp), %edi
movl %r15d, %r10d
movl %r13d, %r9d
movl 0x2c(%rsp), %r13d
jmp 0x16985
cmpl %ebx, %r13d
setge %cl
jge 0x16a27
cmpl %ebx, %r10d
jl 0x16a27
cmpl %ebx, %r9d
jl 0x16a27
movq 0x90(%rsp), %rcx
incl (%rcx)
movq (%rsp), %rcx
leal -0x1(%rcx), %edi
cmpq %rax, %r14
setge %bpl
cmpl %ebx, %r9d
setl %al
cmpl %ebx, %r13d
setl %cl
cmpl %ebx, %r10d
jl 0x169c9
orb %al, %cl
je 0x169c9
testb %bpl, %bpl
je 0x169c9
movl %edi, %r15d
movslq %edi, %rdi
addq 0x18(%rsp), %rdi
movl %r14d, %edx
subl (%rsp), %edx
incq %rdx
movzbl 0x80(%rsp), %esi
movl %r9d, %r13d
callq 0x20f0
movl %r15d, %edi
movl %r13d, %r9d
cmpl %ebx, %r9d
setge %al
andb %al, %r12b
andb %bpl, %r12b
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
xorl %r13d, %r13d
cmpb $0x1, %r12b
jne 0x16a02
movslq %edi, %rdi
addq 0x10(%rsp), %rdi
movl %r14d, %edx
subl (%rsp), %edx
incq %rdx
movzbl 0x80(%rsp), %esi
callq 0x20f0
xorl %r10d, %r10d
xorl %r9d, %r9d
movl 0x8(%rsp), %r8d
incq %r14
movl %r15d, %eax
movq %rax, (%rsp)
cmpq %r14, 0x40(%rsp)
jne 0x1684c
jmp 0x16aca
cmpl %ebx, %r10d
setl %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x16a4a
cmpl %ebx, %r9d
jge 0x16a4a
movq 0x98(%rsp), %rcx
incl (%rcx)
movb $0x1, %cl
jmp 0x168e3
cmpl %ebx, %r13d
jge 0x168e3
cmpl %ebx, %r10d
jge 0x168e3
cmpl %ebx, %r9d
jl 0x168e3
movq 0xa0(%rsp), %rdx
jmp 0x168e1
xorl %esi, %esi
cmpb %r8b, %al
sete %sil
addl %esi, %r13d
xorl %eax, %eax
cmpb %r8b, %dl
sete %al
addl %eax, %r10d
xorl %eax, %eax
cmpb %r8b, %cl
sete %al
addl %eax, %r9d
cmpl $-0x1, (%rsp)
je 0x16aa6
movq (%rsp), %rax
movl %eax, %r15d
jmp 0x16a0d
movl %r14d, %r15d
cmpl $0x1, %r9d
je 0x16ab5
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmpl $0x1, %r10d
cmovel %r14d, %r15d
cmpl $0x1, %r13d
cmovel %r14d, %r15d
jmp 0x16a0d
movsbl %r8b, %ebp
movsbl 0x80(%rsp), %r14d
movq 0x20(%rsp), %rdi
movq 0x30(%rsp), %r15
movl %r15d, %esi
movl %ebp, %edx
movl %r14d, %ecx
movl %ebx, %r8d
callq 0x17bdc
movq 0x18(%rsp), %rdi
movl %r15d, %esi
movl %ebp, %edx
movl %r14d, %ecx
movl %ebx, %r8d
callq 0x17bdc
movq 0x10(%rsp), %rdi
movl %r15d, %esi
movl %ebp, %edx
movl %r14d, %ecx
movl %ebx, %r8d
callq 0x17bdc
movq 0x90(%rsp), %rax
movl (%rax), %eax
movq 0x88(%rsp), %rcx
imull (%rcx), %eax
movq 0x98(%rsp), %rcx
imull (%rcx), %eax
movq 0xa0(%rsp), %rcx
imull (%rcx), %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq