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

  /** Define local variables*/
  int is_success;
  char temporary_string[2*_FILENAMESIZE_+2*_MAX_DETECTOR_NAME_LENGTH_+1024];


  /* Test first whether or not python exists*/
  if (psd->distortions_verbose > 0) {
    printf(" -> Testing python\n");
  }
  is_success = system("python --version");
  class_test(is_success == -1,
             psd->error_message,
             "The command 'python --version' failed.\nPlease install a valid version of python.");

  /* Then activate the PCA generator*/
  if (psd->distortions_verbose > 0) {
    printf(" -> Executing the PCA generator\n");
  }

  if (psd->has_detector_file == _TRUE_) {
    class_sprintf(temporary_string,"python %s %s %s %s %.10e %.10e %i %i %.10e %.10e %.10e",
            psd->sd_PCA_file_generator,
            psd->sd_detector_name,
            ppr->sd_external_path,
            psd->sd_detector_file_name,
            ppr->sd_z_min,
            ppr->sd_z_max,
            ppr->sd_z_size,
            6,
            psd->z_th,
            psd->DI_units,
            psd->x_to_nu);

  }
  else {
    class_sprintf(temporary_string,"python %s %s %.10e %.10e %.10e  %i %.10e %.10e %i %.10e %i %.10e %.10e %.10e",
            psd->sd_PCA_file_generator,
            psd->sd_detector_name,
            psd->sd_detector_nu_min,
            psd->sd_detector_nu_max,
            psd->sd_detector_nu_delta,
            psd->sd_detector_bin_number,
            ppr->sd_z_min,
            ppr->sd_z_max,
            ppr->sd_z_size,
            psd->sd_detector_delta_Ic,
            6,
            psd->z_th,
            psd->DI_units,
            psd->x_to_nu);
  }
  is_success = system(temporary_string);
  class_test(is_success == -1,
             psd->error_message,
             "The command 'python %s' failed.\nPlease make sure the file exists.",psd->sd_PCA_file_generator);

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x16f8, %rsp           # imm = 0x16F8
movq %rsi, %rbx
movq %rdi, %r15
cmpw $0x0, 0x1600(%rsi)
jle 0xcd843
leaq 0x5d7f8(%rip), %rdi     # 0x12b036
callq 0x8510
leaq 0x5c0b9(%rip), %rdi     # 0x129903
callq 0x82f0
cmpl $-0x1, %eax
je 0xcd959
cmpw $0x0, 0x1600(%rbx)
jle 0xcd86e
leaq 0x5d7e0(%rip), %rdi     # 0x12b049
callq 0x8510
leaq 0x6f4(%rbx), %r14
leaq 0x26c(%rbx), %r12
cmpl $0x1, 0xcdc(%rbx)
jne 0xcd9ba
leaq 0x928(%r15), %r13
leaq 0x8(%rbx), %rbp
movsd 0x8f0(%r15), %xmm0
movsd 0x8f8(%r15), %xmm1
movl 0x900(%r15), %eax
movsd 0x388(%rbx), %xmm3
movsd 0x318(%rbx), %xmm2
movsd 0x380(%rbx), %xmm4
movl $0x6, %ecx
movl %ecx, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movq %rbp, (%rsp)
leaq 0x5c0b7(%rip), %rdx     # 0x129994
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rcx
movq %r12, %r8
movq %r13, %r9
movb $0x5, %al
callq 0x8550
incl %eax
movslq %eax, %rsi
movsd 0x8f0(%r15), %xmm0
movsd 0x8f8(%r15), %xmm1
movl 0x900(%r15), %eax
movsd 0x388(%rbx), %xmm3
movsd 0x318(%rbx), %xmm2
movsd 0x380(%rbx), %xmm4
movl $0x6, %ecx
movl %ecx, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movq %rbp, (%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x5c050(%rip), %rdx     # 0x129994
movq %r14, %rcx
movq %r12, %r8
movq %r13, %r9
movb $0x5, %al
callq 0x8550
jmp 0xcdac2
leaq 0x5bfb4(%rip), %rsi     # 0x129914
leaq 0xef0(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x23709(%rip), %rsi     # 0xf1082
leaq 0x5bfe5(%rip), %rdx     # 0x129965
leaq 0x6f0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x23691(%rip), %rsi     # 0xf1034
leaq 0x5bfcc(%rip), %rdx     # 0x129976
movq %rbx, %rdi
movl $0x185, %ecx            # imm = 0x185
movq %r15, %r8
jmp 0xcdb34
movsd 0x2d0(%rbx), %xmm0
movsd 0x2d8(%rbx), %xmm1
movsd 0x2e0(%rbx), %xmm2
movl 0x2e8(%rbx), %r9d
movsd 0x8f0(%r15), %xmm3
movsd 0x8f8(%r15), %xmm4
movl 0x900(%r15), %eax
movsd 0x2f0(%rbx), %xmm5
movsd 0x318(%rbx), %xmm6
movsd 0x388(%rbx), %xmm7
movsd 0x380(%rbx), %xmm8
movsd %xmm8, 0x10(%rsp)
movl $0x6, %ebp
movl %ebp, 0x8(%rsp)
movl %eax, (%rsp)
leaq 0x5bf9e(%rip), %r13     # 0x1299cb
xorl %edi, %edi
xorl %esi, %esi
movq %r13, %rdx
movq %r14, %rcx
movq %r12, %r8
movb $0x8, %al
callq 0x8550
incl %eax
movslq %eax, %rsi
movsd 0x2d0(%rbx), %xmm0
movsd 0x2d8(%rbx), %xmm1
movsd 0x2e0(%rbx), %xmm2
movl 0x2e8(%rbx), %r9d
movsd 0x8f0(%r15), %xmm3
movsd 0x8f8(%r15), %xmm4
movl 0x900(%r15), %eax
movsd 0x2f0(%rbx), %xmm5
movsd 0x318(%rbx), %xmm6
movsd 0x388(%rbx), %xmm7
movsd 0x380(%rbx), %xmm8
movsd %xmm8, 0x10(%rsp)
movl %ebp, 0x8(%rsp)
movl %eax, (%rsp)
leaq 0x20(%rsp), %rdi
movq %r13, %rdx
movq %r14, %rcx
movq %r12, %r8
movb $0x8, %al
callq 0x8550
leaq 0x20(%rsp), %rdi
callq 0x82f0
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0xcdb40
leaq 0x5bf3c(%rip), %rsi     # 0x129a18
leaq 0xef0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x30c2c
leaq 0x2358a(%rip), %rsi     # 0xf1082
leaq 0x5be66(%rip), %rdx     # 0x129965
leaq 0x6f0(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x23512(%rip), %rsi     # 0xf1034
leaq 0x5be4d(%rip), %rdx     # 0x129976
movq %rbx, %rdi
movl $0x1af, %ecx            # imm = 0x1AF
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x16f8, %rsp           # imm = 0x16F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq