// File: /workspace/github_cpp_makefile_star2_O2/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, 0x4(%rsp)
movq %rdi, %r13
leaq 0x1b57(%rip), %r15      # 0x31fd
leaq 0x1b2b(%rip), %rbx      # 0x31d8
xorl %r14d, %r14d
movq %rdi, 0x8(%rsp)
cmpq $0x27, %r14
je 0x17d0
movq 0x4a82(%rip), %rdx      # 0x6148
leaq 0x75f3(%rip), %rdi      # 0x8cc0
movl $0xfa, %esi
callq 0x1160
testq %rax, %rax
je 0x17e3
movq %r14, 0x10(%rsp)
imulq $0x38, %r14, %rax
leaq (%rax,%r13), %rcx
movq %rcx, 0x20(%rsp)
leaq (%rax,%r13), %rcx
addq $0x8, %rcx
movq %rcx, 0x18(%rsp)
leaq 0x10(%r13,%rax), %rbp
leaq 0x18(%r13,%rax), %r14
leaq (%rax,%r13), %r12
addq $0x20, %r12
leaq (%rax,%r13), %rbx
addq $0x28, %rbx
leaq (%rax,%r13), %r15
addq $0x30, %r15
xorl %r13d, %r13d
subq $0x8, %rsp
leaq 0x7591(%rip), %rdi      # 0x8cc0
leaq 0x198f(%rip), %rsi      # 0x30c5
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq %rbp, %r8
movq %r14, %r9
xorl %eax, %eax
pushq %r15
pushq %rbx
pushq %r12
callq 0x10b0
addq $0x20, %rsp
cmpl $0x7, %eax
je 0x1768
incl %r13d
cmpl $0xb, %r13d
jne 0x1724
pushq $0x1
popq %r13
incq 0x74e9(%rip)            # 0x8c58
testl %r13d, %r13d
movq 0x10(%rsp), %r14
leaq 0x6392(%rip), %rcx      # 0x7b10
jne 0x17d5
movq 0x8(%rsp), %r13
movsd (%r13), %xmm0
ucomisd 0x4975(%rip), %xmm0     # 0x6108
leaq 0x1a63(%rip), %r15      # 0x31fd
leaq 0x1a37(%rip), %rbx      # 0x31d8
jne 0x17c8
jp 0x17c8
movb $0x0, 0x496d(%rip)      # 0x6119
xorl %eax, %eax
cmpq $0x888, %rax            # imm = 0x888
je 0x17c8
movsd (%r13,%rax), %xmm0
movsd %xmm0, (%rax,%rcx)
addq $0x8, %rax
jmp 0x17ae
incq %r14
jmp 0x16b5
pushq $0x1
popq %rax
jmp 0x1827
leaq 0x19c4(%rip), %rbx      # 0x31a0
leaq 0x192d(%rip), %r15      # 0x3110
movq 0x4806(%rip), %rdi      # 0x5ff0
movq %rbx, %rsi
callq 0x10c0
movq %rax, %rdi
movl 0x4(%rsp), %ebx
movl %ebx, %esi
callq 0x1180
movq %rax, %rdi
movq %r15, %rsi
callq 0x10c0
imull $0x27, %ebx, %ecx
leal (%rcx,%r14), %esi
addl $-0x26, %esi
movq %rax, %rdi
callq 0x1180
movq %rax, %rdi
callq 0x1080
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq