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

  /** Define local variables */
  int index_x;
  double nu_temp,delta_Ic_temp;
  FILE * infile;
  char line[_LINE_LENGTH_MAX_];
  char * left;
  int headlines = 0;
  int numcols;

  /** Open file */
  class_sprintf(psd->sd_detector_noise_file,"%s/%s",ppr->sd_external_path,psd->sd_detector_file_name);
  class_open(infile, psd->sd_detector_noise_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->x_size, &numcols) != 2,
                 psd->error_message,
                 "could not header (number of lines, number of columns) at line %i in file '%s' \n",headlines,psd->sd_detector_noise_file);
      class_test(numcols !=2,
                 psd->error_message,
                 "Incorrect number of columns in the detector noise file '%s'",psd->sd_detector_noise_file);

      class_alloc(psd->x, psd->x_size*sizeof(double), psd->error_message);
      class_alloc(psd->delta_Ic_array, psd->x_size*sizeof(double), psd->error_message);
      break;
    }
  }

  /** Read parameters */
  for (index_x=0; index_x<psd->x_size; ++index_x){
    class_test(fscanf(infile, "%le",
                      &(nu_temp))!=1,                                                 // [-]
               psd->error_message,
               "Could not read nu at line %i in file '%s'",index_x+headlines,psd->sd_detector_noise_file);
    psd->x[index_x] = nu_temp/psd->x_to_nu;
    class_test(fscanf(infile, "%le",
                      &(delta_Ic_temp))!=1,                            // [-]
               psd->error_message,
               "Could not read delta_Ic(nu) at line %i in file '%s'",index_x+headlines,psd->sd_detector_noise_file);
    psd->delta_Ic_array[index_x] = delta_Ic_temp*1e-26;
  }

  fclose(infile);

  return _SUCCESS_;
}

// Assembly:
subq $0x5c78, %rsp           # imm = 0x5C78
movq %rdi, 0x5c68(%rsp)
movq %rsi, 0x5c60(%rsp)
movl $0x0, 0x5834(%rsp)
movq 0x5c68(%rsp), %rcx
addq $0x928, %rcx            # imm = 0x928
movq 0x5c60(%rsp), %r8
addq $0x8, %r8
xorl %eax, %eax
movl %eax, %esi
leaq 0x76a90(%rip), %rdx     # 0x20a728
movq %rsi, %rdi
movb $0x0, %al
callq 0x8540
movl %eax, 0x582c(%rsp)
movq 0x5c60(%rsp), %rdi
addq $0x390, %rdi            # imm = 0x390
movl 0x582c(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movq 0x5c68(%rsp), %rcx
addq $0x928, %rcx            # imm = 0x928
movq 0x5c60(%rsp), %r8
addq $0x8, %r8
leaq 0x76a41(%rip), %rdx     # 0x20a728
movb $0x0, %al
callq 0x8540
movq 0x5c60(%rsp), %rdi
addq $0x390, %rdi            # imm = 0x390
leaq 0x5cf33(%rip), %rsi     # 0x1f0c37
callq 0x8410
movq %rax, 0x5c40(%rsp)
cmpq $0x0, 0x5c40(%rsp)
jne 0x193d90
leaq 0x5020(%rsp), %rdi
movq 0x5c60(%rsp), %rcx
addq $0x390, %rcx            # imm = 0x390
leaq 0x40c96(%rip), %rsi     # 0x1d49d0
leaq 0x7739d(%rip), %rdx     # 0x20b0de
leaq 0x40cbd(%rip), %r8      # 0x1d4a05
movb $0x0, %al
callq 0x5b9c0
movq 0x5c60(%rsp), %rdi
addq $0x1602, %rdi           # imm = 0x1602
leaq 0x5020(%rsp), %r8
leaq 0x3e2c7(%rip), %rsi     # 0x1d2034
leaq 0x77371(%rip), %rdx     # 0x20b0e5
movl $0x1cb, %ecx            # imm = 0x1CB
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5c74(%rsp)
jmp 0x194328
movq 0x5c60(%rsp), %rax
movl $0x0, 0xc20(%rax)
leaq 0x5840(%rsp), %rdi
movq 0x5c40(%rsp), %rdx
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x8530
cmpq $0x0, %rax
je 0x1940ff
movl 0x5834(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5834(%rsp)
leaq 0x5840(%rsp), %rax
movq %rax, 0x5838(%rsp)
movq 0x5838(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x193e0d
movq 0x5838(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x5838(%rsp)
jmp 0x193de7
movq 0x5838(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x27, %eax
jle 0x1940fa
leaq 0x5840(%rsp), %rdi
movq 0x5c60(%rsp), %rdx
addq $0x368, %rdx            # imm = 0x368
leaq 0x5dddb(%rip), %rsi     # 0x1f1c1a
leaq 0x5830(%rsp), %rcx
movb $0x0, %al
callq 0x83b0
cmpl $0x2, %eax
je 0x193ee9
leaq 0x4820(%rsp), %rdi
movl 0x5834(%rsp), %edx
movq 0x5c60(%rsp), %rcx
addq $0x390, %rcx            # imm = 0x390
leaq 0x7728d(%rip), %rsi     # 0x20b109
movb $0x0, %al
callq 0x5b9c0
leaq 0x4020(%rsp), %rdi
leaq 0x4820(%rsp), %rcx
leaq 0x3e1e8(%rip), %rsi     # 0x1d2082
leaq 0x772b8(%rip), %rdx     # 0x20b159
movb $0x0, %al
callq 0x5b9c0
movq 0x5c60(%rsp), %rdi
addq $0x1602, %rdi           # imm = 0x1602
leaq 0x4020(%rsp), %r8
leaq 0x3e16e(%rip), %rsi     # 0x1d2034
leaq 0x77218(%rip), %rdx     # 0x20b0e5
movl $0x1dc, %ecx            # imm = 0x1DC
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5c74(%rsp)
jmp 0x194328
cmpl $0x2, 0x5830(%rsp)
je 0x193f82
leaq 0x3820(%rsp), %rdi
movq 0x5c60(%rsp), %rdx
addq $0x390, %rdx            # imm = 0x390
leaq 0x77276(%rip), %rsi     # 0x20b18b
movb $0x0, %al
callq 0x5b9c0
leaq 0x3020(%rsp), %rdi
leaq 0x3820(%rsp), %rcx
leaq 0x3e14f(%rip), %rsi     # 0x1d2082
leaq 0x7728d(%rip), %rdx     # 0x20b1c7
movb $0x0, %al
callq 0x5b9c0
movq 0x5c60(%rsp), %rdi
addq $0x1602, %rdi           # imm = 0x1602
leaq 0x3020(%rsp), %r8
leaq 0x3e0d5(%rip), %rsi     # 0x1d2034
leaq 0x7717f(%rip), %rdx     # 0x20b0e5
movl $0x1df, %ecx            # imm = 0x1DF
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5c74(%rsp)
jmp 0x194328
movq 0x5c60(%rsp), %rax
movslq 0x368(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, %rcx
movq 0x5c60(%rsp), %rax
movq %rcx, 0x370(%rax)
movq 0x5c60(%rsp), %rax
cmpq $0x0, 0x370(%rax)
jne 0x19403d
movq 0x5c60(%rsp), %rax
movslq 0x368(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x301c(%rsp)
leaq 0x2810(%rsp), %rdi
movl 0x301c(%rsp), %ecx
leaq 0x3e016(%rip), %rsi     # 0x1d2004
leaq 0x771de(%rip), %rdx     # 0x20b1d3
movb $0x0, %al
callq 0x5b9c0
movq 0x5c60(%rsp), %rdi
addq $0x1602, %rdi           # imm = 0x1602
leaq 0x2810(%rsp), %r8
leaq 0x3e01a(%rip), %rsi     # 0x1d2034
leaq 0x770c4(%rip), %rdx     # 0x20b0e5
movl $0x1e1, %ecx            # imm = 0x1E1
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5c74(%rsp)
jmp 0x194328
movq 0x5c60(%rsp), %rax
movslq 0x368(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, %rcx
movq 0x5c60(%rsp), %rax
movq %rcx, 0xcc8(%rax)
movq 0x5c60(%rsp), %rax
cmpq $0x0, 0xcc8(%rax)
jne 0x1940f8
movq 0x5c60(%rsp), %rax
movslq 0x368(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x280c(%rsp)
leaq 0x2000(%rsp), %rdi
movl 0x280c(%rsp), %ecx
leaq 0x3df5b(%rip), %rsi     # 0x1d2004
leaq 0x7712a(%rip), %rdx     # 0x20b1da
movb $0x0, %al
callq 0x5b9c0
movq 0x5c60(%rsp), %rdi
addq $0x1602, %rdi           # imm = 0x1602
leaq 0x2000(%rsp), %r8
leaq 0x3df5f(%rip), %rsi     # 0x1d2034
leaq 0x77009(%rip), %rdx     # 0x20b0e5
movl $0x1e2, %ecx            # imm = 0x1E2
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5c74(%rsp)
jmp 0x194328
jmp 0x1940ff
jmp 0x193da2
movl $0x0, 0x5c5c(%rsp)
movl 0x5c5c(%rsp), %eax
movq 0x5c60(%rsp), %rcx
cmpl 0x368(%rcx), %eax
jge 0x194310
movq 0x5c40(%rsp), %rdi
leaq 0x770ba(%rip), %rsi     # 0x20b1ee
leaq 0x5c50(%rsp), %rdx
movb $0x0, %al
callq 0x8690
cmpl $0x1, %eax
je 0x1941e5
leaq 0x1800(%rsp), %rdi
movl 0x5c5c(%rsp), %edx
addl 0x5834(%rsp), %edx
movq 0x5c60(%rsp), %rcx
addq $0x390, %rcx            # imm = 0x390
leaq 0x7707a(%rip), %rsi     # 0x20b1f2
movb $0x0, %al
callq 0x5b9c0
leaq 0x1000(%rsp), %rdi
leaq 0x1800(%rsp), %rcx
leaq 0x3deec(%rip), %rsi     # 0x1d2082
leaq 0x7707f(%rip), %rdx     # 0x20b21c
movb $0x0, %al
callq 0x5b9c0
movq 0x5c60(%rsp), %rdi
addq $0x1602, %rdi           # imm = 0x1602
leaq 0x1000(%rsp), %r8
leaq 0x3de72(%rip), %rsi     # 0x1d2034
leaq 0x76f1c(%rip), %rdx     # 0x20b0e5
movl $0x1ec, %ecx            # imm = 0x1EC
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5c74(%rsp)
jmp 0x194328
movsd 0x5c50(%rsp), %xmm0
movq 0x5c60(%rsp), %rax
divsd 0x380(%rax), %xmm0
movq 0x5c60(%rsp), %rax
movq 0x370(%rax), %rax
movslq 0x5c5c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x5c40(%rsp), %rdi
leaq 0x76fc5(%rip), %rsi     # 0x20b1ee
leaq 0x5c48(%rsp), %rdx
movb $0x0, %al
callq 0x8690
cmpl $0x1, %eax
je 0x1942cd
leaq 0x800(%rsp), %rdi
movl 0x5c5c(%rsp), %edx
addl 0x5834(%rsp), %edx
movq 0x5c60(%rsp), %rcx
addq $0x390, %rcx            # imm = 0x390
leaq 0x76fd4(%rip), %rsi     # 0x20b241
movb $0x0, %al
callq 0x5b9c0
movq %rsp, %rdi
leaq 0x800(%rsp), %rcx
leaq 0x3ddfc(%rip), %rsi     # 0x1d2082
leaq 0x76fe8(%rip), %rdx     # 0x20b275
movb $0x0, %al
callq 0x5b9c0
movq 0x5c60(%rsp), %rdi
addq $0x1602, %rdi           # imm = 0x1602
movq %rsp, %r8
leaq 0x3dd87(%rip), %rsi     # 0x1d2034
leaq 0x76e31(%rip), %rdx     # 0x20b0e5
movl $0x1f1, %ecx            # imm = 0x1F1
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x5c74(%rsp)
jmp 0x194328
movsd 0x42553(%rip), %xmm0    # 0x1d6828
mulsd 0x5c48(%rsp), %xmm0
movq 0x5c60(%rsp), %rax
movq 0xcc8(%rax), %rax
movslq 0x5c5c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x5c5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c5c(%rsp)
jmp 0x19410a
movq 0x5c40(%rsp), %rdi
callq 0x83c0
movl $0x0, 0x5c74(%rsp)
movl 0x5c74(%rsp), %eax
addq $0x5c78, %rsp           # imm = 0x5C78
retq
nopw (%rax,%rax)