// File: /workspace/github_c_makefile_star2_O2/josch[P]stride/sheet.c
// Function: Sheet
void Sheet(CHAIN **Chain, int Cn1, int Cn2, HBOND **HBond, COMMAND *Cmd, float **PhiPsiMap)
{
  PATTERN **PatN, **PatP;
  RESIDUE *Res1, *Res3, *Res2, *Res4, *ResA, *ResB, *Res1m1, *Res3p1;
  int R1, R3, R2, R4, RA, RB, PatCntN = 0, PatCntP = 0, Beg;
  char *AntiPar1, *Par1, *AntiPar2, *Par2;
  register int i;

  PatN = (PATTERN **)ckalloc(MAXHYDRBOND*sizeof(PATTERN *));
  PatP = (PATTERN **)ckalloc(MAXHYDRBOND*sizeof(PATTERN *));

  AntiPar1  = (char *)ckalloc(Chain[Cn1]->NRes*sizeof(char)); /* Antiparallel strands */
  Par1      = (char *)ckalloc(Chain[Cn1]->NRes*sizeof(char)); /* Parallel strands */
  AntiPar2  = (char *)ckalloc(Chain[Cn2]->NRes*sizeof(char)); /* Antiparallel strands */
  Par2      = (char *)ckalloc(Chain[Cn2]->NRes*sizeof(char)); /* Parallel strands */

  for( i=0; i<Chain[Cn1]->NRes; i++ ) { 
    AntiPar1[i] = 'C'; 
    Par1[i] = 'C'; 
  }

  for( i=0; i<Chain[Cn2]->NRes; i++ ) { 
    AntiPar2[i] = 'C'; 
    Par2[i] = 'C'; 
  }

  for( R1=0; R1<Chain[Cn1]->NRes; R1++ ) {

    Res1   = Chain[Cn1]->Rsd[R1];

    if( (!Res1->Inv->NBondDnr && !Res1->Inv->NBondAcc) ||
        ((Cn1 != Cn2) && !Res1->Inv->InterchainHBonds) )
      continue;

    RA     = R1+1;
    R2     = R1+2;
    Res1m1 = Chain[Cn1]->Rsd[R1-1];
    ResA   = Chain[Cn1]->Rsd[RA];
    Res2   = Chain[Cn1]->Rsd[R2]; 

    if( R2 >= Chain[Cn1]->NRes || 
        Res1->Prop->PhiZn == ERR || Res1->Prop->PsiZn == ERR ||
        Res2->Prop->PhiZn == ERR || Res2->Prop->PsiZn == ERR ||
        ResA->Prop->PhiZn == ERR || ResA->Prop->PsiZn == ERR ) 
      continue;

    if( Cn1 != Cn2 ) 
      Beg = 0;
    else
      Beg = R1+1;

    for( R3=Beg; R3<Chain[Cn2]->NRes; R3++ ) {

      /* Process anti-parallel strands */

      Res3   = Chain[Cn2]->Rsd[R3];

      if( (!Res3->Inv->NBondAcc && !Res3->Inv->NBondDnr ) || 
	  ((Cn1 != Cn2) && !Res3->Inv->InterchainHBonds) ) 
	continue;

      RB     = R3-1;
      R4     = R3-2;
      Res3p1 = Chain[Cn2]->Rsd[R3+1];
      ResB   = Chain[Cn2]->Rsd[RB];
      Res4   = Chain[Cn2]->Rsd[R4];
      
      if( Cn1 != Cn2 || R3 - R1 >= 3  )
	Link(HBond,Chain,Cn1,Cn2,Res1,Res3,Res3,Res1,Res1,Res3,
	     PhiPsiMap,PatN,&PatCntN,"1331",Cmd->Treshold_E1,Cmd,0);
      
      if( R2 < Chain[Cn1]->NRes && ((Cn1 != Cn2 && R4 >= 0) || R4-R2 >=2 ) )
	Link(HBond,Chain,Cn2,Cn1,Res3,Res1,Res2,Res4,ResB,ResA,
	     PhiPsiMap,PatN,&PatCntN,"3124",Cmd->Treshold_E1,Cmd,0);
      
      if( ((Cn1 != Cn2 && RB >= 0 ) || RB-R1 > 4) && 
	 ( RA >= Chain[Cn1]->NRes || (Cn1 == Cn2 && R3-RA <= 4 ) ||
	  !Link(HBond,Chain,Cn1,Cn2,Res1,Res3,Res3,ResA,NULL,Res3,
		PhiPsiMap,PatN,&PatCntN,"133A",Cmd->Treshold_E1,Cmd,1))
	 &&
	 ( R1-1 < 0 ||
	  !Link(HBond,Chain,Cn1,Cn2,Res1m1,ResB,ResB,Res1,NULL,ResB,
		PhiPsiMap,PatN,&PatCntN,"1-BB1",Cmd->Treshold_E1,Cmd,1)))
	Link(HBond,Chain,Cn1,Cn2,Res1,Res3,ResB,Res1,Res1,NULL,
	     PhiPsiMap,PatN,&PatCntN,"13B1",Cmd->Treshold_E1,Cmd,0);
      
      if( (RA < Chain[Cn1]->NRes && (Cn1 != Cn2 || R3-RA > 4)) &&
	 ( (Cn1 == Cn2 && RB-R1 <= 4 ) || (Cn1 != Cn2 && RB < 0 ) || 
	  !Link(HBond,Chain,Cn1,Cn2,Res1,Res3,ResB,Res1,Res1,NULL,
	        PhiPsiMap,PatN,&PatCntN,"13B1",Cmd->Treshold_E1,Cmd,1))
	 &&
	 ( R3+1 >= Chain[Cn2]->NRes ||
	  !Link(HBond,Chain,Cn1,Cn2,ResA,Res3p1,Res3,ResA,ResA,NULL,
		PhiPsiMap,PatN,&PatCntN,"A3+3A",Cmd->Treshold_E1,Cmd,1)))
	Link(HBond,Chain,Cn1,Cn2,Res1,Res3,Res3,ResA,NULL,Res3,
	     PhiPsiMap,PatN,&PatCntN,"133A",Cmd->Treshold_E1,Cmd,0);
      
      /* Process parallel strands */

      R4 = R3+2; 
      RB = R3+1;
      ResB   = Chain[Cn2]->Rsd[RB];
      Res4   = Chain[Cn2]->Rsd[R4];

      if( (Cn1 == Cn2 && abs(R3-R1) <= 3) || R4 >= Chain[Cn2]->NRes ) continue;
      
      if( R2 < Chain[Cn1]->NRes && (Cn1 != Cn2 || abs(R2-R3) > 3) )
	Link(HBond,Chain,Cn2,Cn1,Res3,Res1,Res2,Res3,Res3,ResA,
	     PhiPsiMap,PatP,&PatCntP,"3123",Cmd->Treshold_E2,Cmd,0);
      
      if( R4 < Chain[Cn2]->NRes && (Cn1 != Cn2 || abs(R4-R1) > 3) )
	Link(HBond,Chain,Cn1,Cn2,Res1,Res3,Res4,Res1,Res1,ResB,
	     PhiPsiMap,PatP,&PatCntP,"1341",Cmd->Treshold_E2,Cmd,0);
    }
  }
    
  FilterAntiPar(PatN,PatCntN);
  FilterPar(PatP,PatCntP);

  MergePatternsAntiPar(PatN,PatCntN);
  MergePatternsPar(PatP,PatCntP);

  if( Cmd->Info )  {
    PrintPatterns(PatN,PatCntN,Chain,Cn1,Cn2);
    PrintPatterns(PatP,PatCntP,Chain,Cn1,Cn2);
  }

  FillAsnAntiPar(AntiPar1,AntiPar2,Chain,Cn1,Cn2,PatN,PatCntN,Cmd);
  FillAsnPar(Par1,Par2,Chain,Cn1,Cn2,PatP,PatCntP,Cmd);

  Bridge(AntiPar1,AntiPar2,Chain,Cn1,Cn2,PatN,PatCntN);
  Bridge(Par1,Par2,Chain,Cn1,Cn2,PatP,PatCntP);

  for( i=0; i<Chain[Cn1]->NRes; i++ )
    if( AntiPar1[i] == 'N' || Par1[i] == 'P' ) 
      Chain[Cn1]->Rsd[i]->Prop->Asn = 'E';
    else
    if( AntiPar1[i] == 'B' || Par1[i] == 'B' )
      Chain[Cn1]->Rsd[i]->Prop->Asn = 'B';
    else
    if( AntiPar1[i] == 'b' || Par1[i] == 'b' )
      Chain[Cn1]->Rsd[i]->Prop->Asn = 'b';

  for( i=0; i<Chain[Cn2]->NRes; i++ )
    if( Chain[Cn2]->Rsd[i]->Prop->Asn == 'E' )
      continue;
    else
    if( AntiPar2[i] == 'N' || Par2[i] == 'P' ) 
      Chain[Cn2]->Rsd[i]->Prop->Asn = 'E';
    else
    if( AntiPar2[i] == 'B' || Par2[i] == 'B' ) 
      Chain[Cn2]->Rsd[i]->Prop->Asn = 'B';
    else
    if( AntiPar2[i] == 'b' || Par2[i] == 'b' ) 
      Chain[Cn2]->Rsd[i]->Prop->Asn = 'b';

/*
  for( i=0; i<PatCntN; i++ )
    free(PatN[i]);
  for( i=0; i<PatCntP; i++ )
    free(PatP[i]);
*/
  free(PatN);
  free(PatP);
  free(AntiPar1);
  free(Par1);
  free(AntiPar2);
  free(Par2);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %r9, 0x40(%rsp)
movq %r8, 0x20(%rsp)
movq %rcx, 0x38(%rsp)
movl %edx, %ebx
movl %esi, %ebp
andl $0x0, 0x14(%rsp)
movq %rdi, %r14
andl $0x0, 0x54(%rsp)
movl $0x61a80, %edi          # imm = 0x61A80
callq 0x50f4
movq %rax, 0x18(%rsp)
movl $0x61a80, %edi          # imm = 0x61A80
callq 0x50f4
movq %rax, 0x58(%rsp)
movl %ebp, 0xc(%rsp)
movslq %ebp, %r15
movq (%r14,%r15,8), %rax
movslq (%rax), %rdi
callq 0x50f4
movq %rax, %rbp
movq (%r14,%r15,8), %rax
movslq (%rax), %rdi
callq 0x50f4
movq %rax, %r12
movl %ebx, 0x10(%rsp)
movslq %ebx, %r13
movq (%r14,%r13,8), %rax
movslq (%rax), %rdi
callq 0x50f4
movq %rax, %rbx
movq %r13, 0x60(%rsp)
movq (%r14,%r13,8), %rax
movslq (%rax), %rdi
callq 0x50f4
movq %r15, %r10
movq %rax, 0x78(%rsp)
xorl %eax, %eax
movb $0x43, %cl
movq (%r14,%r10,8), %rdx
movslq (%rdx), %rdx
cmpq %rdx, %rax
jge 0x5d64
movb %cl, (%rbp,%rax)
movb %cl, (%r12,%rax)
incq %rax
jmp 0x5d4b
xorl %edx, %edx
movb $0x43, %sil
movq 0x60(%rsp), %rdi
movl 0x10(%rsp), %r8d
movl 0xc(%rsp), %r9d
movq (%r14,%rdi,8), %rax
movslq (%rax), %rcx
cmpq %rcx, %rdx
jge 0x5d96
movb %sil, (%rbx,%rdx)
movq 0x78(%rsp), %rax
movb %sil, (%rax,%rdx)
incq %rdx
jmp 0x5d78
movq %r12, 0x88(%rsp)
pushq $0x2
popq %r11
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %r10, 0x28(%rsp)
movq %rbx, 0xa0(%rsp)
movq (%r14,%r10,8), %rdx
movslq (%rdx), %rsi
cmpq %rsi, %r12
jge 0x64da
movq 0x68(%rdx), %rdx
movq (%rdx,%r12,8), %r13
movq 0x770(%r13), %rdi
cmpl $0x0, 0x30(%rdi)
jne 0x5de4
cmpl $0x0, 0x34(%rdi)
je 0x64cc
cmpl %r8d, %r9d
je 0x5df3
cmpl $0x0, 0x38(%rdi)
je 0x64cc
leaq 0x2(%r12), %rdi
movq %rdi, 0x70(%rsp)
cmpq %rsi, %rdi
jge 0x64cc
movq 0x768(%r13), %rsi
cmpl $-0x1, 0xc(%rsi)
je 0x64cc
cmpl $-0x1, 0x10(%rsi)
je 0x64cc
movq 0x10(%rdx,%r12,8), %rsi
movq %rsi, 0xa8(%rsp)
movq 0x768(%rsi), %rsi
cmpl $-0x1, 0xc(%rsi)
je 0x64cc
cmpl $-0x1, 0x10(%rsi)
je 0x64cc
movq 0x8(%rdx,%r12,8), %rsi
movq %rsi, 0x68(%rsp)
movq 0x768(%rsi), %rsi
cmpl $-0x1, 0xc(%rsi)
je 0x64cc
cmpl $-0x1, 0x10(%rsi)
je 0x64cc
movq %r15, 0x30(%rsp)
leaq 0x1(%r12), %rsi
movq -0x8(%rdx,%r12,8), %rdx
movq %rdx, 0xb8(%rsp)
cmpl %r8d, %r9d
movq %rsi, 0xb0(%rsp)
movl %esi, %edx
movl $0x0, %ebx
cmoveq %rdx, %rbx
movl %r11d, %edx
subl %ebx, %edx
movl %edx, 0x84(%rsp)
movq %rbp, 0xc0(%rsp)
movl %r11d, 0x9c(%rsp)
movslq %ecx, %rdx
cmpq %rdx, %rbx
jge 0x64bf
movq 0x68(%rax), %rcx
movq (%rcx,%rbx,8), %r15
movq 0x770(%r15), %rdx
cmpl $0x0, 0x34(%rdx)
jne 0x5ee2
cmpl $0x0, 0x30(%rdx)
je 0x649e
cmpl %r8d, %r9d
je 0x5ef1
cmpl $0x0, 0x38(%rdx)
je 0x649e
movq 0x8(%rcx,%rbx,8), %rax
movq %rax, 0x90(%rsp)
movq -0x10(%rcx,%rbx,8), %rbp
movq -0x8(%rcx,%rbx,8), %rax
movq %rax, 0x48(%rsp)
cmpl %r8d, %r9d
jne 0x5f20
movq 0x30(%rsp), %rax
addq %rbx, %rax
cmpq $0x3, %rax
jl 0x5f7a
movq 0x20(%rsp), %rax
movss 0x1d20(%rax), %xmm0
movq 0x38(%rsp), %rdi
movq %r14, %rsi
movl %r9d, %edx
movl %r8d, %ecx
movq %r13, %r8
movq %r15, %r9
pushq $0x0
pushq %rax
leaq 0x12c95(%rip), %rax     # 0x18be0
pushq %rax
leaq 0x2c(%rsp), %rax
pushq %rax
pushq 0x38(%rsp)
pushq 0x68(%rsp)
pushq %r15
pushq %r13
pushq %r13
pushq %r15
callq 0x674d
movq 0x78(%rsp), %r10
movl 0x5c(%rsp), %r9d
movl 0x60(%rsp), %r8d
addq $0x50, %rsp
movq (%r14,%r10,8), %rax
movslq (%rax), %rax
cmpq %rax, 0x70(%rsp)
jge 0x6017
cmpl %r8d, %r9d
setne %al
cmpq $0x2, %rbx
setae %cl
testb %cl, %al
jne 0x5faf
movq 0x30(%rsp), %rax
addq %rbx, %rax
addq $-0x4, %rax
cmpq $0x2, %rax
jl 0x6017
movq 0x20(%rsp), %rax
movss 0x1d20(%rax), %xmm0
movq 0x38(%rsp), %rdi
movq %r14, %rsi
movl %r8d, %edx
movl %r9d, %ecx
movq %r15, %r8
movq %r13, %r9
pushq $0x0
pushq %rax
leaq 0x12c0b(%rip), %rax     # 0x18be5
pushq %rax
leaq 0x2c(%rsp), %rax
pushq %rax
pushq 0x38(%rsp)
pushq 0x68(%rsp)
pushq 0x98(%rsp)
pushq 0x80(%rsp)
pushq %rbp
pushq 0xf0(%rsp)
callq 0x674d
movq 0x78(%rsp), %r10
movl 0x5c(%rsp), %r9d
movl 0x60(%rsp), %r8d
addq $0x50, %rsp
cmpl %r8d, %r9d
setne %al
testq %rbx, %rbx
setne %cl
andb %al, %cl
movq 0x30(%rsp), %rax
leaq (%rax,%rbx), %rbp
decq %rbp
cmpq $0x5, %rbp
setge %al
orb %cl, %al
cmpb $0x1, %al
jne 0x618e
movq (%r14,%r10,8), %rax
movslq (%rax), %rax
cmpq %rax, 0xb0(%rsp)
jge 0x60c5
cmpl %r8d, %r9d
jne 0x605e
cmpq $0x5, %rbp
jl 0x60c5
movq 0x20(%rsp), %rax
movss 0x1d20(%rax), %xmm0
movq 0x38(%rsp), %rdi
movq %r14, %rsi
movl %r9d, %edx
movl %r8d, %ecx
movq %r13, %r8
movq %r15, %r9
pushq $0x1
pushq %rax
leaq 0x12b61(%rip), %rax     # 0x18bea
pushq %rax
leaq 0x2c(%rsp), %rax
pushq %rax
pushq 0x38(%rsp)
pushq 0x68(%rsp)
pushq %r15
pushq $0x0
pushq 0xa8(%rsp)
pushq %r15
callq 0x674d
movq 0x78(%rsp), %r10
movl 0x5c(%rsp), %r9d
movl 0x60(%rsp), %r8d
addq $0x50, %rsp
testl %eax, %eax
jne 0x618e
testq %r12, %r12
je 0x612f
movq 0x20(%rsp), %rax
movss 0x1d20(%rax), %xmm0
movq 0x38(%rsp), %rdi
movq %r14, %rsi
movl %r9d, %edx
movl %r8d, %ecx
movq 0xb8(%rsp), %r8
movq 0x48(%rsp), %r9
pushq $0x1
pushq %rax
leaq 0x12af3(%rip), %rax     # 0x18bef
pushq %rax
leaq 0x2c(%rsp), %rax
pushq %rax
pushq 0x38(%rsp)
pushq 0x68(%rsp)
pushq %r9
pushq $0x0
pushq %r13
pushq %r9
callq 0x674d
movq 0x78(%rsp), %r10
movl 0x5c(%rsp), %r9d
movl 0x60(%rsp), %r8d
addq $0x50, %rsp
testl %eax, %eax
jne 0x618e
movq 0x20(%rsp), %rax
movss 0x1d20(%rax), %xmm0
movq 0x38(%rsp), %rdi
movq %r14, %rsi
movl %r9d, %edx
movl %r8d, %ecx
movq %r13, %r8
movq %r15, %r9
pushq $0x0
pushq %rax
leaq 0x12a9b(%rip), %rax     # 0x18bf5
pushq %rax
leaq 0x2c(%rsp), %rax
pushq %rax
pushq 0x38(%rsp)
pushq 0x68(%rsp)
pushq $0x0
pushq %r13
pushq %r13
pushq 0x90(%rsp)
callq 0x674d
movq 0x78(%rsp), %r10
movl 0x5c(%rsp), %r9d
movl 0x60(%rsp), %r8d
addq $0x50, %rsp
movq (%r14,%r10,8), %rax
movslq (%rax), %rax
cmpq %rax, 0xb0(%rsp)
jge 0x6312
cmpl %r8d, %r9d
jne 0x61b2
cmpq $0x5, %rbp
jl 0x6312
cmpl %r8d, %r9d
sete %al
setne %dl
cmpq $0x5, %rbp
setl %cl
testq %rbx, %rbx
sete %sil
testb %sil, %dl
jne 0x6239
andb %cl, %al
jne 0x6239
movq 0x20(%rsp), %rax
movss 0x1d20(%rax), %xmm0
movq 0x38(%rsp), %rdi
movq %r14, %rsi
movl %r9d, %edx
movl %r8d, %ecx
movq %r13, %r8
movq %r15, %r9
pushq $0x1
pushq %rax
leaq 0x129f8(%rip), %rax     # 0x18bf5
pushq %rax
leaq 0x2c(%rsp), %rax
pushq %rax
pushq 0x38(%rsp)
pushq 0x68(%rsp)
pushq $0x0
pushq %r13
pushq %r13
pushq 0x90(%rsp)
callq 0x674d
movq 0x78(%rsp), %r10
movl 0x5c(%rsp), %r9d
movl 0x60(%rsp), %r8d
addq $0x50, %rsp
testl %eax, %eax
jne 0x6312
leaq 0x1(%rbx), %rax
movq 0x60(%rsp), %rcx
movq (%r14,%rcx,8), %rcx
movslq (%rcx), %rcx
cmpq %rcx, %rax
jge 0x62b3
movq 0x20(%rsp), %rax
movss 0x1d20(%rax), %xmm0
movq 0x38(%rsp), %rdi
movq %r14, %rsi
movl %r9d, %edx
movl %r8d, %ecx
movq 0x68(%rsp), %r8
movq 0x90(%rsp), %r9
pushq $0x1
pushq %rax
leaq 0x1297a(%rip), %rax     # 0x18bfa
pushq %rax
leaq 0x2c(%rsp), %rax
pushq %rax
pushq 0x38(%rsp)
pushq 0x68(%rsp)
pushq $0x0
pushq %r8
pushq %r8
pushq %r15
callq 0x674d
movq 0x78(%rsp), %r10
movl 0x5c(%rsp), %r9d
movl 0x60(%rsp), %r8d
addq $0x50, %rsp
testl %eax, %eax
jne 0x6312
movq 0x20(%rsp), %rax
movss 0x1d20(%rax), %xmm0
movq 0x38(%rsp), %rdi
movq %r14, %rsi
movl %r9d, %edx
movl %r8d, %ecx
movq %r13, %r8
movq %r15, %r9
pushq $0x0
pushq %rax
leaq 0x1290c(%rip), %rax     # 0x18bea
pushq %rax
leaq 0x2c(%rsp), %rax
pushq %rax
pushq 0x38(%rsp)
pushq 0x68(%rsp)
pushq %r15
pushq $0x0
pushq 0xa8(%rsp)
pushq %r15
callq 0x674d
movq 0x78(%rsp), %r10
movl 0x5c(%rsp), %r9d
movl 0x60(%rsp), %r8d
addq $0x50, %rsp
movq 0x30(%rsp), %rax
addl %ebx, %eax
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
movq 0x60(%rsp), %rax
movq (%r14,%rax,8), %rax
movq 0x68(%rax), %rdx
movq 0x8(%rdx,%rbx,8), %rsi
movq 0x10(%rdx,%rbx,8), %r11
cmpl %r8d, %r9d
jne 0x6345
cmpl $0x4, %ecx
jb 0x649e
leaq 0x2(%rbx), %rbp
movslq (%rax), %rcx
cmpq %rcx, %rbp
jge 0x649e
movq (%r14,%r10,8), %rdx
movslq (%rdx), %rdx
cmpq %rdx, 0x70(%rsp)
jge 0x640a
cmpl %r8d, %r9d
jne 0x6383
movl 0x84(%rsp), %edx
movl %edx, %ecx
negl %ecx
cmovsl %edx, %ecx
cmpl $0x4, %ecx
jb 0x6422
movq %r11, 0x48(%rsp)
movq 0x20(%rsp), %rax
movss 0x1d24(%rax), %xmm0
movq 0x38(%rsp), %rdi
movq %rsi, 0x90(%rsp)
movq %r14, %rsi
movl %r8d, %edx
movl %r9d, %ecx
movq %r15, %r8
movq %r13, %r9
pushq $0x0
pushq %rax
leaq 0x12845(%rip), %rax     # 0x18c00
pushq %rax
leaq 0x6c(%rsp), %rax
pushq %rax
pushq 0x78(%rsp)
pushq 0x68(%rsp)
pushq 0x98(%rsp)
pushq %r15
pushq %r15
pushq 0xf0(%rsp)
callq 0x674d
movq 0xe0(%rsp), %rsi
movq 0x78(%rsp), %r10
movl 0x5c(%rsp), %r9d
movl 0x60(%rsp), %r8d
addq $0x50, %rsp
movq 0x60(%rsp), %rax
movq (%r14,%rax,8), %rax
movslq (%rax), %rcx
jmp 0x640f
movq %r11, 0x48(%rsp)
cmpq %rcx, %rbp
jge 0x649e
cmpl %r8d, %r9d
movq 0x48(%rsp), %r11
jne 0x6438
movq 0x30(%rsp), %rcx
addl %ebx, %ecx
addl $0x2, %ecx
movl %ecx, %edx
negl %edx
cmovsl %ecx, %edx
cmpl $0x4, %edx
jb 0x649e
movq 0x20(%rsp), %rax
movss 0x1d24(%rax), %xmm0
movq 0x38(%rsp), %rdi
movq %rsi, %r10
movq %r14, %rsi
movl %r9d, %edx
movl %r8d, %ecx
movq %r13, %r8
movq %r15, %r9
pushq $0x0
pushq %rax
leaq 0x1279f(%rip), %rax     # 0x18c05
pushq %rax
leaq 0x6c(%rsp), %rax
pushq %rax
pushq 0x78(%rsp)
pushq 0x68(%rsp)
pushq %r10
pushq %r13
pushq %r13
pushq %r11
callq 0x674d
movq 0x78(%rsp), %r10
movl 0x5c(%rsp), %r9d
movl 0x60(%rsp), %r8d
addq $0x50, %rsp
movq 0x60(%rsp), %rax
movq (%r14,%rax,8), %rax
incq %rbx
movl (%rax), %ecx
decl 0x84(%rsp)
movq 0xc0(%rsp), %rbp
movl 0x9c(%rsp), %r11d
jmp 0x5eb7
movq 0xa0(%rsp), %rbx
movq 0x30(%rsp), %r15
incq %r12
decq %r15
incl %r11d
jmp 0x5db5
movl 0x14(%rsp), %esi
movq %rsi, 0x30(%rsp)
movq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0xe5d7
movl 0x54(%rsp), %r13d
movq 0x58(%rsp), %r15
movq %r15, %rdi
movl %r13d, %esi
callq 0xe99e
movq %r12, %rdi
movq 0x30(%rsp), %rsi
callq 0x99b0
movq %r15, %rdi
movq %r13, 0x70(%rsp)
movl %r13d, %esi
callq 0xab2a
movq 0x20(%rsp), %rax
cmpl $0x0, 0x1d60(%rax)
je 0x656a
movq 0x18(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq %r14, %rdx
movl 0xc(%rsp), %r15d
movl %r15d, %ecx
movl 0x10(%rsp), %r12d
movl %r12d, %r8d
callq 0x6b10
movq 0x58(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq %r14, %rdx
movl %r15d, %ecx
movl %r12d, %r8d
callq 0x6b10
movq %rbp, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl 0xc(%rsp), %r15d
movl %r15d, %ecx
movl 0x10(%rsp), %r12d
movl %r12d, %r8d
movq 0x18(%rsp), %r9
movq 0x20(%rsp), %r13
pushq %r13
pushq 0x38(%rsp)
callq 0xbc74
popq %rax
popq %rcx
movq 0x88(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq %r14, %rdx
movl %r15d, %ecx
movl %r12d, %r8d
movq 0x58(%rsp), %r9
pushq %r13
movq 0x78(%rsp), %r13
pushq %r13
callq 0xd23a
popq %rax
popq %rcx
subq $0x8, %rsp
movq %rbp, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %r15d, %ecx
movl %r12d, %r8d
movq 0x20(%rsp), %r9
pushq 0x38(%rsp)
callq 0x6e6a
popq %rax
popq %rcx
subq $0x8, %rsp
movq 0x90(%rsp), %rdi
movq 0x60(%rsp), %rax
movq 0x80(%rsp), %rsi
movq %r14, %rdx
movl %r15d, %ecx
movq %rax, %r15
movl %r12d, %r8d
movq %rax, %r9
pushq %r13
callq 0x6e6a
addq $0x10, %rsp
movq 0x28(%rsp), %rax
movq (%r14,%rax,8), %rax
movl (%rax), %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
movq 0x60(%rsp), %r9
cmpq %rdx, %rcx
je 0x668f
movb (%rbp,%rdx), %dil
movb $0x45, %sil
cmpb $0x4e, %dil
je 0x6657
movq 0x88(%rsp), %r8
movb (%r8,%rdx), %r8b
cmpb $0x50, %r8b
jne 0x666f
movq 0x68(%rax), %rdi
movq (%rdi,%rdx,8), %rdi
movq 0x768(%rdi), %rdi
movb %sil, 0x1c(%rdi)
incq %rdx
jmp 0x6632
movb $0x42, %sil
cmpb $0x42, %dil
je 0x6657
cmpb $0x42, %r8b
je 0x6657
movb $0x62, %sil
cmpb $0x62, %dil
je 0x6657
cmpb $0x62, %r8b
jne 0x666a
jmp 0x6657
movq (%r14,%r9,8), %rax
movl (%rax), %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
movq 0xa0(%rsp), %rbx
movq 0x18(%rsp), %rdi
cmpq %rdx, %rcx
je 0x6708
movq 0x68(%rax), %rsi
movq (%rsi,%rdx,8), %rsi
movq 0x768(%rsi), %rsi
cmpb $0x45, 0x1c(%rsi)
je 0x66e3
movb (%rbx,%rdx), %r8b
movb $0x45, %r10b
cmpb $0x4e, %r8b
je 0x66df
movq 0x78(%rsp), %r9
movb (%r9,%rdx), %r9b
cmpb $0x50, %r9b
jne 0x66e8
movb %r10b, 0x1c(%rsi)
incq %rdx
jmp 0x66a9
movb $0x42, %r10b
cmpb $0x42, %r8b
je 0x66df
cmpb $0x42, %r9b
je 0x66df
movb $0x62, %r10b
cmpb $0x62, %r8b
je 0x66df
cmpb $0x62, %r9b
jne 0x66e3
jmp 0x66df
callq 0x2040
movq %r15, %rdi
callq 0x2040
movq %rbp, %rdi
callq 0x2040
movq 0x88(%rsp), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movq 0x78(%rsp), %rdi
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040