// File: /workspace/github_cpp_makefile_star2_O3/BhanuPrakashN[P]sparse_chol/smatrix.cpp
// Function: UpdateF(Fmatrix*, double*, std::vector<int, std::allocator<int>>*)
Fm *UpdateF(Fm *F,double *l_b,vector<int> *Pind){
    Fm *U=(Fm*)malloc(sizeof(Fm));
    U->n=(F->n)-1;
    U->x=(double **)calloc(U->n,sizeof(double *));
    for(int i=0;i<U->n;i++)
        U->x[i]=(double*)calloc(U->n,sizeof(double));
    vector<int> *Gind=F->indices;
    U->indices =new vector<int>;
    int temp=0;
    if(Pind!=NULL)sort(Pind->begin(),Pind->end());
    //printf("Pind:");
    //for(int i=0;i<Pind->size();i++)
      //  printf("%d ",Pind->at(i) );
    //printf("\nGind:");
    //for(int i=0;i<Gind->size();i++)
      //  printf("%d ",Gind->at(i) );  
    

    for(int i=1;i<F->n;i++){
        //temp=0;
        while(Pind->at(temp)!=Gind->at(i))temp++;
        U->indices->push_back(temp);
    }
    //printf("\nLind:");
    //for(int i=0;i<U->indices->size();i++)
    //    printf("%d ",U->indices->at(i) );
    for(int i=0;i<U->n;i++){
        for(int j=0;j<U->n;j++){
            U->x[i][j]=F->x[i+1][j+1]-l_b[i]*l_b[j];
        }
    }

    return U;



}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, -0x48(%rbp)
movq %rsi, %rbx
movq %rdi, %r15
movl $0x18, %edi
callq 0x1150
movq %rax, %r14
movq %r15, -0x38(%rbp)
movslq (%r15), %r15
leaq -0x1(%r15), %r13
movl %r13d, (%rax)
movl $0x8, %esi
movq %r13, %rdi
callq 0x10a0
movq %rax, %r12
movq %r14, -0x50(%rbp)
movq %rax, 0x10(%r14)
movq %r15, -0x40(%rbp)
cmpq $0x2, %r15
jl 0x2128
movl %r13d, %r14d
xorl %r15d, %r15d
movl $0x8, %esi
movq %r13, %rdi
callq 0x10a0
movq %rax, (%r12,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0x210f
movq %r13, -0x58(%rbp)
movq %r12, -0x60(%rbp)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %r15
movl $0x18, %edi
callq 0x1100
movq %rax, %r12
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq -0x50(%rbp), %rax
movq %r12, 0x8(%rax)
movl $0x0, -0x2c(%rbp)
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %r10
testq %r10, %r10
je 0x21b8
movq (%r10), %r14
movq 0x8(%r10), %r13
movq -0x40(%rbp), %rax
cmpq %r13, %r14
je 0x21b8
movq %r13, %rax
subq %r14, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0x27fa
movq %r14, %rdi
movq %r13, %rsi
callq 0x28db
movq -0x48(%rbp), %r10
movq -0x38(%rbp), %rax
movl (%rax), %eax
cmpl $0x2, %eax
movq -0x38(%rbp), %r9
jl 0x225b
movl $0x1, %r14d
movq (%r10), %rcx
movq 0x8(%r10), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
movslq -0x2c(%rbp), %rdi
cmpq %rdi, %rdx
jbe 0x22d0
movq (%r15), %r8
movq 0x8(%r15), %rax
subq %r8, %rax
sarq $0x2, %rax
cmpq %r14, %rax
jbe 0x22c1
movl (%rcx,%rdi,4), %eax
cmpl (%r8,%r14,4), %eax
je 0x221f
movq %rdi, %rsi
incq %rsi
leal 0x1(%rdi), %eax
movl %eax, -0x2c(%rbp)
movq %rsi, %rdi
cmpq %rsi, %rdx
ja 0x21fd
jmp 0x22d3
movq 0x8(%r12), %rsi
cmpq 0x10(%r12), %rsi
je 0x2238
movl %edi, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r12)
jmp 0x224c
movq %r12, %rdi
leaq -0x2c(%rbp), %rdx
callq 0x26c2
movq -0x48(%rbp), %r10
movq -0x38(%rbp), %r9
incq %r14
movslq (%r9), %rax
cmpq %rax, %r14
jl 0x21cb
cmpl $0x2, -0x40(%rbp)
movq -0x60(%rbp), %r10
movq -0x58(%rbp), %r13
jl 0x22ae
movl %r13d, %eax
movq 0x10(%r9), %rcx
xorl %edx, %edx
movq 0x8(%rcx,%rdx,8), %rsi
movq (%r10,%rdx,8), %rdi
xorl %r8d, %r8d
movsd 0x8(%rsi,%r8,8), %xmm0
movsd (%rbx,%rdx,8), %xmm1
mulsd (%rbx,%r8,8), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, (%rdi,%r8,8)
leaq 0x1(%r8), %r9
movq %r9, %r8
cmpq %r9, %rax
jne 0x227e
incq %rdx
cmpq %rax, %rdx
jne 0x2272
movq -0x50(%rbp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xda1(%rip), %rdi       # 0x3069
movq %r14, %rsi
movq %rax, %rdx
jmp 0x22da
movq %rdi, %rsi
leaq 0xd8f(%rip), %rdi       # 0x3069
xorl %eax, %eax
callq 0x1190