// File: /workspace/github_c_makefile_star2_O2/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 0x5b2ee(%rip), %r13     # 0x11e419
xorl %r14d, %r14d
xorl %edi, %edi
xorl %esi, %esi
movq %r13, %rdx
movq %r15, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8580
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 0x8580
leaq 0x40afe(%rip), %rsi     # 0x103c64
movq %rbp, %rdi
callq 0x8420
testq %rax, %rax
je 0xc3366
movq %rax, %r15
leaq 0xc20(%rbx), %r12
andl $0x0, 0xc20(%rbx)
leaq 0x1280(%rsp), %r13
movq %r13, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
movq %r15, %rdx
callq 0x8570
testq %rax, %rax
je 0xc327c
movq %r13, %rcx
movb (%rcx), %al
incq %rcx
cmpb $0x20, %al
je 0xc31ac
incl %r14d
cmpb $0x28, %al
jl 0xc3190
leaq 0xc68(%rbx), %rcx
leaq 0x41aa9(%rip), %rsi     # 0x104c73
leaq 0x1280(%rsp), %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x83b0
cmpl $0x2, %eax
jne 0xc341d
movslq 0xc20(%rbx), %r13
leaq (,%r13,8), %rbp
movq %rbp, %rdi
callq 0x8490
movq %rax, 0xc18(%rbx)
testq %rax, %rax
je 0xc3483
movq %rbp, %rdi
callq 0x8490
movq %rax, 0xc28(%rbx)
testq %rax, %rax
je 0xc34cc
movq %rbp, %rdi
callq 0x8490
movq %rax, 0xc38(%rbx)
testq %rax, %rax
je 0xc3515
movq %rbp, %rdi
callq 0x8490
movq %rax, 0xc48(%rbx)
testq %rax, %rax
je 0xc3711
movslq 0xc68(%rbx), %rbp
imulq %r13, %rbp
leaq (,%rbp,8), %rdi
callq 0x8490
movq %rax, 0xc58(%rbx)
testq %rax, %rax
je 0xc3757
movq %r12, 0x8(%rsp)
leaq 0x5a7ba(%rip), %r13     # 0x11da42
xorl %r12d, %r12d
movq 0x8(%rsp), %rax
movslq (%rax), %rax
cmpq %rax, %r12
jge 0xc355e
leaq (,%r12,8), %rbp
movq 0xc18(%rbx), %rdx
addq %rbp, %rdx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x86c0
cmpl $0x1, %eax
jne 0xc356d
movq 0xc28(%rbx), %rdx
addq %rbp, %rdx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x86c0
cmpl $0x1, %eax
jne 0xc35d6
movq 0xc38(%rbx), %rdx
addq %rbp, %rdx
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x86c0
cmpl $0x1, %eax
jne 0xc363f
addq 0xc48(%rbx), %rbp
movq %r15, %rdi
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x86c0
cmpl $0x1, %eax
jne 0xc36a8
xorl %ebp, %ebp
cmpl 0xc68(%rbx), %ebp
jge 0xc335e
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 0x86c0
incl %ebp
cmpl $0x1, %eax
je 0xc3326
jmp 0xc33b4
incq %r12
jmp 0xc328b
leaq 0x2463b(%rip), %rsi     # 0xe79a8
leaq 0x5a5be(%rip), %rdx     # 0x11d932
leaq 0x24662(%rip), %r8      # 0xe79dd
leaq 0x280(%rsp), %r14
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x21c94(%rip), %rsi     # 0xe5034
leaq 0x5b08d(%rip), %rdx     # 0x11e434
movq %rbx, %rdi
movl $0x591, %ecx            # imm = 0x591
jmp 0xc3799
addl %r12d, %r14d
leaq 0x5b2ea(%rip), %rsi     # 0x11e6a8
leaq 0x280(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2e014
leaq 0x21ca3(%rip), %rsi     # 0xe5082
leaq 0x5b2f2(%rip), %rdx     # 0x11e6d8
leaq 0xa80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x21c2b(%rip), %rsi     # 0xe5034
leaq 0x5b024(%rip), %rdx     # 0x11e434
movq %rbx, %rdi
movl $0x5c4, %ecx            # imm = 0x5C4
jmp 0xc3799
leaq 0x5b029(%rip), %rsi     # 0x11e44d
leaq 0x280(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2e014
leaq 0x21c3d(%rip), %rsi     # 0xe5082
leaq 0x5b054(%rip), %rdx     # 0x11e4a0
leaq 0xa80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x21bc5(%rip), %rsi     # 0xe5034
leaq 0x5afbe(%rip), %rdx     # 0x11e434
movq %rbx, %rdi
movl $0x5a2, %ecx            # imm = 0x5A2
jmp 0xc3799
shll $0x3, %r13d
leaq 0x21b76(%rip), %rsi     # 0xe5004
leaq 0x5b04a(%rip), %rdx     # 0x11e4df
leaq 0x280(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x21b7c(%rip), %rsi     # 0xe5034
leaq 0x5af75(%rip), %rdx     # 0x11e434
movq %rbx, %rdi
movl $0x5a4, %ecx            # imm = 0x5A4
jmp 0xc3799
shll $0x3, %r13d
leaq 0x21b2d(%rip), %rsi     # 0xe5004
leaq 0x5b011(%rip), %rdx     # 0x11e4ef
leaq 0x280(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x21b33(%rip), %rsi     # 0xe5034
leaq 0x5af2c(%rip), %rdx     # 0x11e434
movq %rbx, %rdi
movl $0x5a5, %ecx            # imm = 0x5A5
jmp 0xc3799
shll $0x3, %r13d
leaq 0x21ae4(%rip), %rsi     # 0xe5004
leaq 0x5afd7(%rip), %rdx     # 0x11e4fe
leaq 0x280(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x21aea(%rip), %rsi     # 0xe5034
leaq 0x5aee3(%rip), %rdx     # 0x11e434
movq %rbx, %rdi
movl $0x5a6, %ecx            # imm = 0x5A6
jmp 0xc3799
movq %r15, %rdi
callq 0x83c0
xorl %eax, %eax
jmp 0xc37a6
addl %r12d, %r14d
leaq 0x5afb1(%rip), %rsi     # 0x11e528
leaq 0x280(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2e014
leaq 0x21aea(%rip), %rsi     # 0xe5082
leaq 0x5afb2(%rip), %rdx     # 0x11e551
leaq 0xa80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x21a72(%rip), %rsi     # 0xe5034
leaq 0x5ae6b(%rip), %rdx     # 0x11e434
movq %rbx, %rdi
movl $0x5b3, %ecx            # imm = 0x5B3
jmp 0xc3799
addl %r12d, %r14d
leaq 0x5afa7(%rip), %rsi     # 0x11e587
leaq 0x280(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2e014
leaq 0x21a81(%rip), %rsi     # 0xe5082
leaq 0x5afaa(%rip), %rdx     # 0x11e5b2
leaq 0xa80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x21a09(%rip), %rsi     # 0xe5034
leaq 0x5ae02(%rip), %rdx     # 0x11e434
movq %rbx, %rdi
movl $0x5b7, %ecx            # imm = 0x5B7
jmp 0xc3799
addl %r12d, %r14d
leaq 0x5af9e(%rip), %rsi     # 0x11e5e7
leaq 0x280(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2e014
leaq 0x21a18(%rip), %rsi     # 0xe5082
leaq 0x5afa1(%rip), %rdx     # 0x11e612
leaq 0xa80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x219a0(%rip), %rsi     # 0xe5034
leaq 0x5ad99(%rip), %rdx     # 0x11e434
movq %rbx, %rdi
movl $0x5bb, %ecx            # imm = 0x5BB
jmp 0xc3799
addl %r12d, %r14d
leaq 0x5af95(%rip), %rsi     # 0x11e647
leaq 0x280(%rsp), %r15
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2e014
leaq 0x219af(%rip), %rsi     # 0xe5082
leaq 0x5af99(%rip), %rdx     # 0x11e673
leaq 0xa80(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x21937(%rip), %rsi     # 0xe5034
leaq 0x5ad30(%rip), %rdx     # 0x11e434
movq %rbx, %rdi
movl $0x5bf, %ecx            # imm = 0x5BF
jmp 0xc3799
shll $0x3, %r13d
leaq 0x218e8(%rip), %rsi     # 0xe5004
leaq 0x5adea(%rip), %rdx     # 0x11e50d
leaq 0x280(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x218ee(%rip), %rsi     # 0xe5034
leaq 0x5ace7(%rip), %rdx     # 0x11e434
movq %rbx, %rdi
movl $0x5a7, %ecx            # imm = 0x5A7
jmp 0xc3799
shll $0x3, %ebp
leaq 0x218a3(%rip), %rsi     # 0xe5004
leaq 0x5adb5(%rip), %rdx     # 0x11e51d
leaq 0x280(%rsp), %r14
movq %r14, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x218aa(%rip), %rsi     # 0xe5034
leaq 0x5aca3(%rip), %rdx     # 0x11e434
movq %rbx, %rdi
movl $0x5a9, %ecx            # imm = 0x5A9
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x1688, %rsp           # imm = 0x1688
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq