// File: /workspace/github_c_makefile_star2_O2/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 0xc29b7
leaq 0x5c55c(%rip), %rdi     # 0x11ef0e
callq 0x8540
leaq 0x5ae1d(%rip), %rdi     # 0x11d7db
callq 0x8310
cmpl $-0x1, %eax
je 0xc2ac9
cmpw $0x0, 0x1600(%rbx)
jle 0xc29e2
leaq 0x5c544(%rip), %rdi     # 0x11ef21
callq 0x8540
leaq 0x6f4(%rbx), %r14
leaq 0x26c(%rbx), %r12
cmpl $0x1, 0xcdc(%rbx)
jne 0xc2b2a
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
pushq $0x6
popq %rcx
movl %ecx, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movq %rbp, (%rsp)
leaq 0x5ae1d(%rip), %rdx     # 0x11d86c
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rcx
movq %r12, %r8
movq %r13, %r9
movb $0x5, %al
callq 0x8580
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
pushq $0x6
popq %rcx
movl %ecx, 0x10(%rsp)
movl %eax, 0x8(%rsp)
movq %rbp, (%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x5adb8(%rip), %rdx     # 0x11d86c
movq %r14, %rcx
movq %r12, %r8
movq %r13, %r9
movb $0x5, %al
callq 0x8580
jmp 0xc2c30
leaq 0x5ad1c(%rip), %rsi     # 0x11d7ec
leaq 0xef0(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x22599(%rip), %rsi     # 0xe5082
leaq 0x5ad4d(%rip), %rdx     # 0x11d83d
leaq 0x6f0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x22521(%rip), %rsi     # 0xe5034
leaq 0x5ad34(%rip), %rdx     # 0x11d84e
movq %rbx, %rdi
movl $0x185, %ecx            # imm = 0x185
movq %r15, %r8
jmp 0xc2ca2
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)
pushq $0x6
popq %rbp
movl %ebp, 0x8(%rsp)
movl %eax, (%rsp)
leaq 0x5ad08(%rip), %r13     # 0x11d8a3
xorl %edi, %edi
xorl %esi, %esi
movq %r13, %rdx
movq %r14, %rcx
movq %r12, %r8
movb $0x8, %al
callq 0x8580
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 0x8580
leaq 0x20(%rsp), %rdi
callq 0x8310
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0xc2cac
leaq 0x5aca6(%rip), %rsi     # 0x11d8f0
leaq 0xef0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2e014
leaq 0x2241c(%rip), %rsi     # 0xe5082
leaq 0x5abd0(%rip), %rdx     # 0x11d83d
leaq 0x6f0(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x223a4(%rip), %rsi     # 0xe5034
leaq 0x5abb7(%rip), %rdx     # 0x11d84e
movq %rbx, %rdi
movl $0x1af, %ecx            # imm = 0x1AF
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x16f8, %rsp           # imm = 0x16F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq