// File: 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
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x190, -0x1c(%rbp)     # imm = 0x190
movl -0x1c(%rbp), %esi
incl %esi
leaq -0x30(%rbp), %rdi
callq 0x8320
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x9d02(%rip), %rsi      # 0xda7e
callq 0x22d0
movq %rax, -0x80(%rbp)
jmp 0x3d87
movq -0x80(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq 0x9ce0(%rip), %rdx      # 0xda7e
movl $0x1, %ecx
callq 0x2ed0
movl $0x0, -0x74(%rbp)
movq -0x50(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x2dc0
movl %eax, -0x84(%rbp)
jmp 0x3dc7
movl -0x84(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $-0x1, %eax
je 0x3f29
movq -0x38(%rbp), %rdi
leaq 0x9a4e(%rip), %rsi      # 0xd832
leaq -0x60(%rbp), %rdx
leaq -0x39(%rbp), %rcx
leaq -0x61(%rbp), %r8
leaq -0x3a(%rbp), %r9
leaq -0x68(%rbp), %r11
leaq -0x6c(%rbp), %r10
leaq -0x70(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x2200
movl %eax, -0x40(%rbp)
cmpl $0x7, -0x40(%rbp)
je 0x3eb5
movq 0xf1af(%rip), %rax      # 0x12fd8
movq (%rax), %rdi
leaq 0x9a14(%rip), %rsi      # 0xd847
movb $0x0, %al
callq 0x2330
movq 0xf197(%rip), %rax      # 0x12fd8
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x9a06(%rip), %rsi      # 0xd855
movb $0x0, %al
callq 0x2330
movq 0xf17b(%rip), %rax      # 0x12fd8
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
leaq 0x99f4(%rip), %rsi      # 0xd85f
movb $0x0, %al
callq 0x2330
cmpl $0x7, -0x40(%rbp)
jne 0x3e7a
jmp 0x3eb3
leaq 0x99e8(%rip), %rdi      # 0xd869
leaq 0x9961(%rip), %rsi      # 0xd7e9
movl $0x2eb, %edx            # imm = 0x2EB
leaq 0x9b44(%rip), %rcx      # 0xd9d8
callq 0x2170
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x8360
jmp 0x3f64
jmp 0x3eb5
cmpl $0x0, -0x14(%rbp)
jne 0x3eea
movl -0x68(%rbp), %edi
movl -0x6c(%rbp), %esi
movl -0x70(%rbp), %edx
callq 0x2f60
movsd %xmm0, -0x90(%rbp)
jmp 0x3ed3
movsd -0x90(%rbp), %xmm0
movq -0x10(%rbp), %rax
movslq -0x74(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x3f1b
movl -0x68(%rbp), %edi
movl -0x6c(%rbp), %esi
movl -0x70(%rbp), %edx
callq 0x2fd0
movss %xmm0, -0x94(%rbp)
jmp 0x3f02
movss -0x94(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x10(%rbp), %rax
movslq -0x74(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x3daf
movl -0x74(%rbp), %eax
movl %eax, -0x44(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x3f43
movq -0x50(%rbp), %rdi
callq 0x2210
jmp 0x3f41
jmp 0x3f43
movl -0x44(%rbp), %eax
movl %eax, -0x98(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x8360
movl -0x98(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x2380
nopl (%rax)