// File: /workspace/github_cpp_makefile_star2_O3/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, %rbx
leaq 0x64a6(%rip), %rdi      # 0x7ce0
xorl %r14d, %r14d
movl %esi, 0x4(%rsp)
movq %rbx, 0x10(%rsp)
movq 0x391b(%rip), %rdx      # 0x5168
movl $0xfa, %esi
callq 0x11b0
testq %rax, %rax
je 0x19f0
movq %r14, 0x8(%rsp)
imulq $0x38, %r14, %rax
leaq (%rbx,%rax), %rcx
movq %rcx, 0x20(%rsp)
leaq (%rbx,%rax), %rcx
addq $0x8, %rcx
movq %rcx, 0x18(%rsp)
movq %rbx, %rcx
leaq 0x10(%rbx,%rax), %rbx
leaq 0x18(%rcx,%rax), %r12
leaq (%rcx,%rax), %r15
addq $0x20, %r15
leaq (%rcx,%rax), %r13
addq $0x28, %r13
leaq (%rcx,%rax), %rbp
addq $0x30, %rbp
xorl %r14d, %r14d
subq $0x8, %rsp
leaq 0x642e(%rip), %rdi      # 0x7ce0
leaq 0x180c(%rip), %rsi      # 0x30c5
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq %rbx, %r8
movq %r12, %r9
xorl %eax, %eax
pushq %rbp
pushq %r13
pushq %r15
callq 0x10f0
addq $0x20, %rsp
cmpl $0x7, %eax
je 0x18e9
decl %r14d
cmpl $-0xb, %r14d
jne 0x18a7
jmp 0x1957
incq 0x6388(%rip)            # 0x7c78
testl %r14d, %r14d
jne 0x195e
movq 0x10(%rsp), %rbx
movsd (%rbx), %xmm0
ucomisd 0x3822(%rip), %xmm0     # 0x5128
movl 0x4(%rsp), %ebp
movq 0x8(%rsp), %r14
leaq 0x521a(%rip), %rcx      # 0x6b30
jne 0x1939
jp 0x1939
movb $0x0, 0x3818(%rip)      # 0x5139
xorl %eax, %eax
movsd (%rbx,%rax), %xmm0
movsd %xmm0, (%rax,%rcx)
addq $0x8, %rax
cmpq $0x888, %rax            # imm = 0x888
jne 0x1923
incq %r14
cmpq $0x27, %r14
leaq 0x6399(%rip), %rdi      # 0x7ce0
jne 0x1846
movl $0x1, %eax
jmp 0x19e1
incq 0x631a(%rip)            # 0x7c78
movq 0x368b(%rip), %rbx      # 0x4ff0
leaq 0x1834(%rip), %rsi      # 0x31a0
movl $0x37, %edx
movq %rbx, %rdi
callq 0x1130
movq %rbx, %rdi
movl 0x4(%rsp), %ebp
movl %ebp, %esi
callq 0x11d0
movq %rax, %rbx
leaq 0x177f(%rip), %rsi      # 0x3110
movl $0x6, %edx
movq %rax, %rdi
callq 0x1130
movq 0x8(%rsp), %r14
imull $0x27, %ebp, %eax
leal (%rax,%r14), %esi
addl $-0x26, %esi
movq %rbx, %rdi
callq 0x11d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
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
movq 0x35f9(%rip), %rbx      # 0x4ff0
leaq 0x17da(%rip), %rsi      # 0x31d8
movl $0x24, %edx
movq %rbx, %rdi
callq 0x1130
movq %rbx, %rdi
movl %ebp, %esi
callq 0x11d0
movq %rax, %rbx
leaq 0x17de(%rip), %rsi      # 0x31fd
movl $0x8, %edx
movq %rax, %rdi
callq 0x1130
jmp 0x19a3