// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/align_tnm.c
// Function: PDB_ali
int PDB_ali(int *ali, int *seq_id, int nali,
	    char *ali1, struct chain *chp1, int n1,
	    char *ali2, struct chain *chp2, int n2)
{
  int i1=0, i2=0, j1, j2, k=0; *seq_id=0;
  for(int i=0; i<n1; i++)ali[i]=-1;
  for(int i=0; i<nali; i++){
    // seq.1
    if(ali1[i]!='-'){j1=chp1->ali_seqres[i1]; i1++;}
    else{j1=-1;}
    if(j1>=0){ali1[k]=chp1->seq[j1];}
    else{ali1[k]='-';}
    // seq.2
    if(ali2[i]!='-'){j2=chp2->ali_seqres[i2]; i2++;}
    else{j2=-1;}
    if(j2>=0){ali2[k]=chp2->seq[j2];}
    else{ali2[k]='-';}
    if(j1>=0){
      ali[j1]=j2;
      if(ali1[k]==ali2[k])(*seq_id)++;
    }
    if((j1>=0)||(j2>=0)){k++;}
  }
  return(k);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x20(%rbp), %eax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x1792e
movq -0x8(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x1790c
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x17a69
movq -0x20(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2d, %eax
je 0x1796f
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x17976
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
cmpl $0x0, -0x38(%rbp)
jl 0x17998
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x38(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x20(%rbp), %rax
movslq -0x40(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x179a4
movq -0x20(%rbp), %rax
movslq -0x40(%rbp), %rcx
movb $0x2d, (%rax,%rcx)
movq 0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2d, %eax
je 0x179d2
movq 0x18(%rbp), %rax
movq 0x68(%rax), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x179d9
movl $0xffffffff, -0x3c(%rbp) # imm = 0xFFFFFFFF
cmpl $0x0, -0x3c(%rbp)
jl 0x179fb
movq 0x18(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x3c(%rbp), %rcx
movb (%rax,%rcx), %dl
movq 0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movb %dl, (%rax,%rcx)
jmp 0x17a07
movq 0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movb $0x2d, (%rax,%rcx)
cmpl $0x0, -0x38(%rbp)
jl 0x17a44
movl -0x3c(%rbp), %edx
movq -0x8(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movslq -0x40(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movq 0x10(%rbp), %rcx
movslq -0x40(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jne 0x17a42
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x17a44
cmpl $0x0, -0x38(%rbp)
jge 0x17a50
cmpl $0x0, -0x3c(%rbp)
jl 0x17a59
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x17a5b
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x17935
movl -0x40(%rbp), %eax
popq %rbp
retq
nop