// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../source/distortions.c
// Function: distortions_read_br_data
int distortions_read_br_data(struct precision * ppr,
                             struct distortions * psd){

  /** Define local variables */
  int index_k,index_z;
  FILE * infile;
  DetectorFileName br_file;
  char line[_LINE_LENGTH_MAX_];
  char * left;
  int headlines = 0;

  /** Open file */
  class_sprintf(br_file,"%s/%s_branching_ratios.dat", ppr->sd_external_path, psd->sd_detector_name);
  class_open(infile, br_file, "r", psd->error_message);

  /** Read header */
  psd->br_exact_Nz = 0;
  while (fgets(line,_LINE_LENGTH_MAX_-1,infile) != NULL) {
    headlines++;

    /* Eliminate blank spaces at beginning of line */
    left=line;
    while (left[0]==' ') {
      left++;
    }

    if (left[0] > 39) {
      /** Read number of lines, infer size of arrays and allocate them */
      class_test(sscanf(line,"%d %d", &psd->br_exact_Nz, &psd->E_vec_size) != 2,
                 psd->error_message,
                 "could not header (number of lines, number of multipoles) at line %i in file '%s' \n",headlines,br_file);

      class_alloc(psd->br_exact_z, psd->br_exact_Nz*sizeof(double), psd->error_message);
      class_alloc(psd->f_g_exact, psd->br_exact_Nz*sizeof(double), psd->error_message);
      class_alloc(psd->f_y_exact, psd->br_exact_Nz*sizeof(double), psd->error_message);
      class_alloc(psd->f_mu_exact, psd->br_exact_Nz*sizeof(double), psd->error_message);

      class_alloc(psd->E_vec, psd->br_exact_Nz*psd->E_vec_size*sizeof(double), psd->error_message);
      break;
    }
  }

  /** Read parameters */
  for (index_z=0; index_z<psd->br_exact_Nz; ++index_z){
    class_test(fscanf(infile, "%le",
                      &(psd->br_exact_z[index_z]))!=1,                                // [-]
               psd->error_message,
               "Could not read z at line %i in file '%s'",index_z+headlines,br_file);
    class_test(fscanf(infile, "%le",
                      &(psd->f_g_exact[index_z]))!=1,                                 // [-]
               psd->error_message,
               "Could not read f_g at line %i in file '%s'",index_z+headlines,br_file);
    class_test(fscanf(infile, "%le",
                      &(psd->f_y_exact[index_z]))!=1,                                 // [-]
               psd->error_message,
               "Could not read f_y at line %i in file '%s'",index_z+headlines,br_file);
    class_test(fscanf(infile,"%le",
                      &(psd->f_mu_exact[index_z]))!=1,                                // [-]
               psd->error_message,
               "Could not read f_mu at line %i in file '%s'",index_z+headlines,br_file);
    for (index_k=0; index_k<psd->E_vec_size; ++index_k){
      class_test(fscanf(infile,"%le",
                        &(psd->E_vec[index_k*psd->br_exact_Nz+index_z]))!=1,           // [-]
                 psd->error_message,
                 "Could not read E vector at line %i in file '%s'",index_z+headlines,br_file);
    }
  }

  fclose(infile);

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1688, %rsp           # imm = 0x1688
movq %rsi, %rbx
leaq 0x928(%rdi), %r15
leaq 0x26c(%rsi), %r12
leaq 0x5ce10(%rip), %r13     # 0x127569
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8550
incl %eax
movslq %eax, %rsi
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rdx
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8550
leaq 0x42610(%rip), %rsi     # 0x10cda4
movq %rbp, %rdi
callq 0x8400
testq %rax, %rax
je 0xca8fd
movq %rax, %r15
leaq 0xc20(%rbx), %r12
movl $0x0, 0xc20(%rbx)
leaq 0x1280(%rsp), %r13
movq %r13, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
movq %r15, %rdx
callq 0x8540
testq %rax, %rax
je 0xca94b
movq %r13, %rcx
movb (%rcx), %al
incq %rcx
cmpb $0x20, %al
je 0xca7dd
incl %r14d
cmpb $0x28, %al
jl 0xca7c1
leaq 0xc68(%rbx), %rcx
leaq 0x435d8(%rip), %rsi     # 0x10ddd3
leaq 0x1280(%rsp), %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x8390
cmpl $0x2, %eax
jne 0xcaa56
movq %r12, 0x8(%rsp)
movl 0xc20(%rbx), %ebp
movslq %ebp, %r12
leaq (,%r12,8), %r13
movq %r13, %rdi
callq 0x8460
movq %rax, 0xc18(%rbx)
testq %rax, %rax
je 0xcab25
movq %r13, %rdi
callq 0x8460
movq %rax, 0xc28(%rbx)
testq %rax, %rax
je 0xcab6c
movq %r13, %rdi
callq 0x8460
movq %rax, 0xc38(%rbx)
testq %rax, %rax
je 0xcabb3
movq %r13, %rdi
callq 0x8460
movq %rax, 0xc48(%rbx)
testq %rax, %rax
je 0xcad9b
movslq 0xc68(%rbx), %r13
imulq %r12, %r13
leaq (,%r13,8), %rdi
callq 0x8460
movq %rax, 0xc58(%rbx)
testq %rax, %rax
jne 0xca954
shll $0x3, %r13d
leaq 0x23745(%rip), %rsi     # 0xee004
leaq 0x5cda7(%rip), %rdx     # 0x12766d
leaq 0x280(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x2374b(%rip), %rsi     # 0xee034
leaq 0x5cc94(%rip), %rdx     # 0x127584
movq %rbx, %rdi
movl $0x5a9, %ecx            # imm = 0x5A9
jmp 0xcaddd
leaq 0x260e4(%rip), %rsi     # 0xf09e8
leaq 0x5c177(%rip), %rdx     # 0x126a82
leaq 0x2610b(%rip), %r8      # 0xf0a1d
leaq 0x280(%rsp), %r14
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x236fd(%rip), %rsi     # 0xee034
leaq 0x5cc46(%rip), %rdx     # 0x127584
movq %rbx, %rdi
movl $0x591, %ecx            # imm = 0x591
jmp 0xcaddd
movq %r12, 0x8(%rsp)
movl (%r12), %ebp
testl %ebp, %ebp
jle 0xcaa47
leaq 0x5c22f(%rip), %r13     # 0x126b92
xorl %r12d, %r12d
leaq (,%r12,8), %rbp
movq 0xc18(%rbx), %rdx
addq %rbp, %rdx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x8690
cmpl $0x1, %eax
jne 0xcabfa
movq 0xc28(%rbx), %rdx
addq %rbp, %rdx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x8690
cmpl $0x1, %eax
jne 0xcac63
movq 0xc38(%rbx), %rdx
addq %rbp, %rdx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x8690
cmpl $0x1, %eax
jne 0xcaccc
addq 0xc48(%rbx), %rbp
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x8690
cmpl $0x1, %eax
jne 0xcad35
cmpl $0x0, 0xc68(%rbx)
jle 0xcaa33
xorl %ebp, %ebp
movl 0xc20(%rbx), %eax
imull %ebp, %eax
addl %r12d, %eax
movslq %eax, %rdx
shlq $0x3, %rdx
addq 0xc58(%rbx), %rdx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x8690
cmpl $0x1, %eax
jne 0xcaabc
incl %ebp
cmpl 0xc68(%rbx), %ebp
jl 0xca9f9
incq %r12
movq 0x8(%rsp), %rax
movslq (%rax), %rax
cmpq %rax, %r12
jl 0xca966
movq %r15, %rdi
callq 0x83a0
xorl %eax, %eax
jmp 0xcadec
leaq 0x5cb40(%rip), %rsi     # 0x12759d
leaq 0x280(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x30af0
leaq 0x23604(%rip), %rsi     # 0xee082
leaq 0x5cb6b(%rip), %rdx     # 0x1275f0
leaq 0xa80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x2358c(%rip), %rsi     # 0xee034
leaq 0x5cad5(%rip), %rdx     # 0x127584
movq %rbx, %rdi
movl $0x5a2, %ecx            # imm = 0x5A2
jmp 0xcaddd
addl %r12d, %r14d
leaq 0x5cd32(%rip), %rsi     # 0x1277f8
leaq 0x280(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x30af0
leaq 0x2359b(%rip), %rsi     # 0xee082
leaq 0x5cd3a(%rip), %rdx     # 0x127828
leaq 0xa80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x23523(%rip), %rsi     # 0xee034
leaq 0x5ca6c(%rip), %rdx     # 0x127584
movq %rbx, %rdi
movl $0x5c4, %ecx            # imm = 0x5C4
jmp 0xcaddd
shll $0x3, %ebp
leaq 0x234d5(%rip), %rsi     # 0xee004
leaq 0x5caf9(%rip), %rdx     # 0x12762f
leaq 0x280(%rsp), %r14
movq %r14, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x234dc(%rip), %rsi     # 0xee034
leaq 0x5ca25(%rip), %rdx     # 0x127584
movq %rbx, %rdi
movl $0x5a4, %ecx            # imm = 0x5A4
jmp 0xcaddd
shll $0x3, %ebp
leaq 0x2348e(%rip), %rsi     # 0xee004
leaq 0x5cac2(%rip), %rdx     # 0x12763f
leaq 0x280(%rsp), %r14
movq %r14, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x23495(%rip), %rsi     # 0xee034
leaq 0x5c9de(%rip), %rdx     # 0x127584
movq %rbx, %rdi
movl $0x5a5, %ecx            # imm = 0x5A5
jmp 0xcaddd
shll $0x3, %ebp
leaq 0x23447(%rip), %rsi     # 0xee004
leaq 0x5ca8a(%rip), %rdx     # 0x12764e
leaq 0x280(%rsp), %r14
movq %r14, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x2344e(%rip), %rsi     # 0xee034
leaq 0x5c997(%rip), %rdx     # 0x127584
movq %rbx, %rdi
movl $0x5a6, %ecx            # imm = 0x5A6
jmp 0xcaddd
addl %r12d, %r14d
leaq 0x5ca74(%rip), %rsi     # 0x127678
leaq 0x280(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x30af0
leaq 0x2345d(%rip), %rsi     # 0xee082
leaq 0x5ca75(%rip), %rdx     # 0x1276a1
leaq 0xa80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x233e5(%rip), %rsi     # 0xee034
leaq 0x5c92e(%rip), %rdx     # 0x127584
movq %rbx, %rdi
movl $0x5b3, %ecx            # imm = 0x5B3
jmp 0xcaddd
addl %r12d, %r14d
leaq 0x5ca6a(%rip), %rsi     # 0x1276d7
leaq 0x280(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x30af0
leaq 0x233f4(%rip), %rsi     # 0xee082
leaq 0x5ca6d(%rip), %rdx     # 0x127702
leaq 0xa80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x2337c(%rip), %rsi     # 0xee034
leaq 0x5c8c5(%rip), %rdx     # 0x127584
movq %rbx, %rdi
movl $0x5b7, %ecx            # imm = 0x5B7
jmp 0xcaddd
addl %r12d, %r14d
leaq 0x5ca61(%rip), %rsi     # 0x127737
leaq 0x280(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x30af0
leaq 0x2338b(%rip), %rsi     # 0xee082
leaq 0x5ca64(%rip), %rdx     # 0x127762
leaq 0xa80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x23313(%rip), %rsi     # 0xee034
leaq 0x5c85c(%rip), %rdx     # 0x127584
movq %rbx, %rdi
movl $0x5bb, %ecx            # imm = 0x5BB
jmp 0xcaddd
addl %r12d, %r14d
leaq 0x5ca58(%rip), %rsi     # 0x127797
leaq 0x280(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x30af0
leaq 0x23322(%rip), %rsi     # 0xee082
leaq 0x5ca5c(%rip), %rdx     # 0x1277c3
leaq 0xa80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x232aa(%rip), %rsi     # 0xee034
leaq 0x5c7f3(%rip), %rdx     # 0x127584
movq %rbx, %rdi
movl $0x5bf, %ecx            # imm = 0x5BF
jmp 0xcaddd
shll $0x3, %ebp
leaq 0x2325f(%rip), %rsi     # 0xee004
leaq 0x5c8b1(%rip), %rdx     # 0x12765d
leaq 0x280(%rsp), %r14
movq %r14, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x23266(%rip), %rsi     # 0xee034
leaq 0x5c7af(%rip), %rdx     # 0x127584
movq %rbx, %rdi
movl $0x5a7, %ecx            # imm = 0x5A7
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x1688, %rsp           # imm = 0x1688
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq