// File: /workspace/github_c_makefile_star2_O3/josch[P]stride/elem.c
// Function: CompareElements
int CompareElements(char *Asn1, char *Asn2, char *Asn3, int Length, 
		   char SecStrType, int *Better, int *Worse)
{

  register int i, j, Count1, Count2;
  int TotalNumber = 0, Beg;

  *Better = 0;
  *Worse = 0;

  Beg = -1;
  
  for( i=0; i<Length; i++ ) {
    if( (Asn1[i] == SecStrType || Asn2[i] == SecStrType || Asn3[i] == SecStrType) &&
	(i == 0 || 
	 ( Asn1[i-1] != SecStrType && Asn2[i-1] != SecStrType && Asn3[i-1] != SecStrType) ) ) {
      TotalNumber++;
      Beg = i;
    }
    else
    if( Beg != -1 && ( i == Length-1 || 
	 ( Asn1[i] != SecStrType && Asn2[i] != SecStrType && Asn3[i] != SecStrType ) ) ) {
      Count1 = Count2 = 0;
      for( j=Beg; j<=i; j++ ) {
	if( (Asn1[j] == SecStrType || Asn2[j] == SecStrType) && Asn1[j] != Asn2[j] ) 
	  Count1++;
	if( (Asn3[j] == SecStrType || Asn2[j] == SecStrType) && Asn3[j] != Asn2[j] ) 
	  Count2++;
      }
      if( Count1 > Count2 ) 
	(*Worse)++;
      else
      if( Count2 > Count1 ) 
	(*Better)++;
      Beg = -1;
    }
  }
  return(TotalNumber);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x38(%rsp), %rax
xorl %r11d, %r11d
movq %r9, -0x8(%rsp)
movl %r11d, (%r9)
movl %r11d, (%rax)
testl %ecx, %ecx
jle 0x16d02
leal -0x1(%rcx), %r9d
movl %ecx, %r10d
xorl %ebx, %ebx
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl $0x1, %ebp
xorl %r11d, %r11d
movq %rdx, -0x30(%rsp)
movq %rsi, -0x38(%rsp)
movq %rdi, -0x10(%rsp)
movq %r9, -0x18(%rsp)
movq %r10, -0x20(%rsp)
movb (%rdi,%rbx), %cl
cmpb %r8b, %cl
je 0x16bbe
cmpb %r8b, (%rsi,%rbx)
je 0x16bbe
cmpb %r8b, (%rdx,%rbx)
jne 0x16be0
testq %rbx, %rbx
je 0x16ca7
cmpb %r8b, -0x1(%rbx,%rdi)
je 0x16be0
cmpb %r8b, -0x1(%rsi,%rbx)
je 0x16be0
cmpb %r8b, -0x1(%rdx,%rbx)
jne 0x16ca7
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl $-0x1, %r15d
je 0x16cf1
cmpq %r9, %rbx
jne 0x16caf
movslq %r15d, %r12
cmpq %r12, %rbx
jl 0x16cf1
movl %r11d, -0x24(%rsp)
leaq (%rsi,%r12), %r13
leaq (%rdi,%r12), %r10
addq %rdx, %r12
movl %ebp, %r11d
subl %r15d, %r11d
xorl %r15d, %r15d
xorl %r9d, %r9d
xorl %ecx, %ecx
movb (%r10,%r15), %sil
movb (%r13,%r15), %dl
cmpb %r8b, %sil
jne 0x16c36
movl %edx, %r14d
jmp 0x16c3e
movl %r8d, %r14d
cmpb %r8b, %dl
jne 0x16c4b
xorl %edx, %edx
cmpb %r14b, %sil
setne %dl
addl %edx, %ecx
movl %r14d, %edx
movb (%r12,%r15), %sil
cmpb %r8b, %sil
sete %r14b
cmpb %r8b, %dl
sete %al
orb %r14b, %al
cmpb %dl, %sil
setne %dl
andb %al, %dl
movzbl %dl, %eax
addl %eax, %r9d
incq %r15
cmpl %r15d, %r11d
jne 0x16c23
cmpl %r9d, %ecx
movl -0x24(%rsp), %r11d
jle 0x16cc9
movq 0x38(%rsp), %rax
incl (%rax)
movq -0x30(%rsp), %rdx
movq -0x38(%rsp), %rsi
movq -0x10(%rsp), %rdi
movq -0x18(%rsp), %r9
movq -0x20(%rsp), %r10
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x16cf1
incl %r11d
movl %ebx, %r14d
jmp 0x16cf1
cmpb %r8b, %cl
je 0x16cc4
cmpb %r8b, (%rsi,%rbx)
je 0x16cc4
cmpb %r8b, (%rdx,%rbx)
jne 0x16bf9
movl %r15d, %r14d
jmp 0x16cf1
movq -0x10(%rsp), %rdi
movq -0x18(%rsp), %r9
movq -0x20(%rsp), %r10
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jge 0x16ce7
movq -0x8(%rsp), %rax
incl (%rax)
movq -0x30(%rsp), %rdx
movq -0x38(%rsp), %rsi
incq %rbx
incl %ebp
movl %r14d, %r15d
cmpq %r10, %rbx
jne 0x16baa
movl %r11d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq