// File: /workspace/github_c_makefile_star2_O0/asford[P]tmalign/./TMalign.h
// Function: detailed_search(double**, double**, int, int, int*, double*, double (*) [3], int, int)
double detailed_search( double **x,
                        double **y, 
                        int x_len, 
                        int y_len, 
                        int invmap0[],
                        double t[3],
                        double u[3][3],
                        int simplify_step,
                        int score_sum_method                        
                       )
{
    //x is model, y is template, try to superpose onto y
    int i, j, k;     
    double tmscore;
    double rmsd;



    k=0;
    for(i=0; i<y_len; i++) 
    {
        j=invmap0[i];
        if(j>=0) //aligned
        {
            xtm[k][0]=x[j][0];
            xtm[k][1]=x[j][1];
            xtm[k][2]=x[j][2];
                
            ytm[k][0]=y[i][0];
            ytm[k][1]=y[i][1];
            ytm[k][2]=y[i][2];
            k++;
        }
    }
    
    //detailed search 40-->1
    tmscore=TMscore8_search(xtm, ytm, k, t, u, simplify_step, score_sum_method, &rmsd);  
   
    return tmscore;
}

// Assembly:
subq $0x58, %rsp
movl 0x70(%rsp), %eax
movl 0x68(%rsp), %eax
movq 0x60(%rsp), %rax
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movl %edx, 0x44(%rsp)
movl %ecx, 0x40(%rsp)
movq %r8, 0x38(%rsp)
movq %r9, 0x30(%rsp)
movl $0x0, 0x24(%rsp)
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
cmpl 0x40(%rsp), %eax
jge 0x40a1a0
movq 0x38(%rsp), %rax
movslq 0x2c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, 0x28(%rsp)
cmpl $0x0, 0x28(%rsp)
jl 0x40a18e
movq 0x50(%rsp), %rax
movslq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
movq 0x200530(%rip), %rax    # 0x60a5e0
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax)
movq 0x50(%rsp), %rax
movslq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd 0x8(%rax), %xmm0
movq 0x200509(%rip), %rax    # 0x60a5e0
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, 0x8(%rax)
movq 0x50(%rsp), %rax
movslq 0x28(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd 0x10(%rax), %xmm0
movq 0x2004e1(%rip), %rax    # 0x60a5e0
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, 0x10(%rax)
movq 0x48(%rsp), %rax
movslq 0x2c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
movq 0x2004c2(%rip), %rax    # 0x60a5e8
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax)
movq 0x48(%rsp), %rax
movslq 0x2c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd 0x8(%rax), %xmm0
movq 0x20049b(%rip), %rax    # 0x60a5e8
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, 0x8(%rax)
movq 0x48(%rsp), %rax
movslq 0x2c(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd 0x10(%rax), %xmm0
movq 0x200473(%rip), %rax    # 0x60a5e8
movslq 0x24(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, 0x10(%rax)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x40a190
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x40a06d
movq 0x200439(%rip), %rdi    # 0x60a5e0
movq 0x20043a(%rip), %rsi    # 0x60a5e8
movl 0x24(%rsp), %edx
movq 0x30(%rsp), %rcx
movq 0x60(%rsp), %r8
movl 0x68(%rsp), %r9d
movl 0x70(%rsp), %r10d
leaq 0x10(%rsp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x4097f0
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
addq $0x58, %rsp
retq
nopw (%rax,%rax)