// File: /workspace/github_cpp_makefile_star2_O1/lagoproject[P]arti/analysis/analysis.cc
// Function: ReadDataBlock(double*, int)
int ReadDataBlock(double *block, int blk) {
  int read_line_error = 0, check = 0, read_no_error=1;
  for (int row=0; row<block_rows; row++) {
    if (fgets(line,250,fi)!=NULL) {
      do {
        check=sscanf(
          line, "%le %le %le %le %le %le %le\n", 
          &block[block_cols * row + 0], 
          &block[block_cols * row + 1], 
          &block[block_cols * row + 2],
          &block[block_cols * row + 3], 
          &block[block_cols * row + 4], 
          &block[block_cols * row + 5], 
          &block[block_cols * row + 6]
        );
      } while (check != block_cols && read_line_error++ < read_tries);
      lines++;
      if (read_line_error) {
        cerr << "Error: Bad data block (missing elements) at data block "<< blk << ", row " << (blk-1)*block_rows+row+1 << endl;
        read_no_error=0;
        break;
      }
    }
    else {
      cerr << "Error: EOF while reading data block " << blk << " at row " << (blk-1)*block_rows+row+1 << endl;
      read_no_error=0;
      break;
    }
    //one more check: if the first element of DataBlock is 7.77778E+07, then there is no secondaries, and we read evt_footer!
    if (block[0] == chk_block[3]) {
      b_data=false;
      for (int i=0; i<block_size; i++) 
        evt_footer[i] = block[i];
    }
  }
  return read_no_error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
movq %rdi, %r15
xorl %r14d, %r14d
movl %esi, 0x4(%rsp)
movq %rdi, 0x8(%rsp)
movq 0x3921(%rip), %rdx      # 0x5178
leaq 0x6492(%rip), %rdi      # 0x7cf0
movl $0xfa, %esi
callq 0x11c0
testq %rax, %rax
je 0x1968
movq %r14, 0x10(%rsp)
imulq $0x38, %r14, %rax
leaq (%r15,%rax), %rcx
movq %rcx, 0x20(%rsp)
leaq (%r15,%rax), %rcx
addq $0x8, %rcx
movq %rcx, 0x18(%rsp)
leaq 0x10(%r15,%rax), %rbx
leaq 0x18(%r15,%rax), %r12
leaq (%r15,%rax), %r14
addq $0x20, %r14
leaq (%r15,%rax), %r13
addq $0x28, %r13
leaq (%r15,%rax), %rbp
addq $0x30, %rbp
xorl %r15d, %r15d
subq $0x8, %rsp
leaq 0x6430(%rip), %rdi      # 0x7cf0
leaq 0x17f6(%rip), %rsi      # 0x30bd
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq %rbx, %r8
movq %r12, %r9
xorl %eax, %eax
pushq %rbp
pushq %r13
pushq %r14
callq 0x1100
addq $0x20, %rsp
cmpl $0x7, %eax
je 0x18fb
incl %r15d
cmpl $0xb, %r15d
jne 0x18b5
movl $0x1, %r15d
incq 0x6386(%rip)            # 0x7c88
testl %r15d, %r15d
movl 0x4(%rsp), %ebp
movq 0x10(%rsp), %r14
leaq 0x522b(%rip), %rcx      # 0x6b40
jne 0x199e
movq 0x8(%rsp), %r15
movsd (%r15), %xmm0
ucomisd 0x380b(%rip), %xmm0     # 0x5138
jne 0x1951
jp 0x1951
movb $0x0, 0x3811(%rip)      # 0x5149
xorl %eax, %eax
movsd (%r15,%rax), %xmm0
movsd %xmm0, (%rax,%rcx)
addq $0x8, %rax
cmpq $0x888, %rax            # imm = 0x888
jne 0x193a
incq %r14
cmpq $0x27, %r14
jne 0x1850
movl $0x1, %eax
jmp 0x1a18
movq 0x3681(%rip), %rbx      # 0x4ff0
leaq 0x185a(%rip), %rsi      # 0x31d0
movl $0x24, %edx
movq %rbx, %rdi
callq 0x1140
movq %rbx, %rdi
movl %ebp, %esi
callq 0x11e0
movq %rax, %rbx
leaq 0x185e(%rip), %rsi      # 0x31f5
movl $0x8, %edx
jmp 0x19d2
movq 0x364b(%rip), %rbx      # 0x4ff0
leaq 0x17ec(%rip), %rsi      # 0x3198
movl $0x37, %edx
movq %rbx, %rdi
callq 0x1140
movq %rbx, %rdi
movl %ebp, %esi
callq 0x11e0
movq %rax, %rbx
leaq 0x173b(%rip), %rsi      # 0x3108
movl $0x6, %edx
movq %rax, %rdi
callq 0x1140
imull $0x27, %ebp, %eax
leal (%rax,%r14), %esi
addl $-0x26, %esi
movq %rbx, %rdi
callq 0x11e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10b0
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq