// File: /workspace/github_cpp_makefile_star2_O2/nanjiangshu[P]calSOV/calSOV.cpp
// Function: ReadConf(char const*, double*, int)
int ReadConf(const char *infile, double *predConf, int typeConfidence)/*{{{*/
{
    int linesize;
    int maxline = 400;
    Array1D <char> line_1darray(maxline+1);
    char *line = line_1darray.array1D;
    char aa;
    char obs_sec;
    int status_sscanf = 0;

    int seqLength = 0;
    FILE *fp = fopen(infile, "r");
    checkfilestream(fp, infile, "r", true);
    int num ; 
    char shape;
    int probH;
    int probS;
    int probR;
    int cntRes = 0;
    while((linesize=fgetline(fp, line, maxline)) != EOF)
    { 
        status_sscanf = sscanf(line,"%d %c %c %c %d %d %d" , &num,&aa,&shape, &obs_sec,&probH,&probS,&probR);
        if (status_sscanf != 7)
        {
            fprintf(stderr,"sscanf error!");
            fprintf(stderr,"File: %s\n", infile);
            fprintf(stderr,"line: %s\n", line);
            assert (status_sscanf == 7);
        }

        if (typeConfidence == 0) /*Raw confidence*/
        {
            predConf[cntRes] = GetRawHSRConfidence(probH, probS, probR);
        }
        else 
        {
            predConf[cntRes] = GetNormHSRConfidence(probH, probS, probR);
        }

        cntRes ++;
    } 
    seqLength = cntRes;
    if (fp != NULL) { fclose(fp); }
    return seqLength;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r13
movl $0x191, %edi            # imm = 0x191
callq 0x2030
movq %rax, %rbx
movq %rax, 0x30(%rsp)
movl $0x191, 0x28(%rsp)      # imm = 0x191
leaq 0x4759(%rip), %r14      # 0x7a6f
movq %r13, %rdi
movq %r14, %rsi
callq 0x2220
movq %rax, %r12
pushq $0x1
popq %rcx
movq %rax, %rdi
movq %r13, 0x18(%rsp)
movq %r13, %rsi
movq %r14, %rdx
callq 0x2a98
leaq 0xa(%rsp), %r14
xorl %r13d, %r13d
movq %r12, %rdi
movq %rbx, %rsi
movl $0x190, %edx            # imm = 0x190
callq 0x29fd
cmpl $-0x1, %eax
je 0x33ec
subq $0x8, %rsp
movq %rbx, %rdi
leaq 0x44c6(%rip), %rsi      # 0x782f
leaq 0x2c(%rsp), %rdx
leaq 0x13(%rsp), %rcx
leaq 0x11(%rsp), %r8
movq %r14, %r9
xorl %eax, %eax
leaq 0x14(%rsp), %r10
pushq %r10
leaq 0x20(%rsp), %r10
pushq %r10
leaq 0x2c(%rsp), %r10
pushq %r10
callq 0x2190
addq $0x20, %rsp
cmpl $0x7, %eax
jne 0x3415
movl 0x14(%rsp), %edi
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
testl %ebp, %ebp
je 0x33bb
callq 0x2b0e
cvtss2sd %xmm0, %xmm0
jmp 0x33de
leal (%rsi,%rdi), %eax
addl %edx, %eax
cvtsi2sd %eax, %xmm1
cmpl %esi, %edi
cmovgl %edi, %esi
cmpl %edx, %esi
cmovlel %edx, %esi
addsd 0x3c32(%rip), %xmm1     # 0x7008
cvtsi2sd %esi, %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, (%r15,%r13,8)
incq %r13
jmp 0x3342
testq %r12, %r12
je 0x33f9
movq %r12, %rdi
callq 0x21a0
leaq 0x28(%rsp), %rdi
callq 0x5bf8
movl %r13d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7bbc(%rip), %r14      # 0xafd8
movq (%r14), %rcx
leaq 0x441e(%rip), %rdi      # 0x7844
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
callq 0x22e0
movq (%r14), %rdi
leaq 0x4417(%rip), %rsi      # 0x7852
movq 0x18(%rsp), %rdx
xorl %eax, %eax
callq 0x2290
movq (%r14), %rdi
leaq 0x440b(%rip), %rsi      # 0x785c
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2290
leaq 0x4404(%rip), %rdi      # 0x7866
leaq 0x437d(%rip), %rsi      # 0x77e6
leaq 0x4565(%rip), %rcx      # 0x79d5
movl $0x2eb, %edx            # imm = 0x2EB
callq 0x2140