// File: /workspace/github_c_makefile_star2_O3/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 0xc9fcb
leaq 0x5e098(%rip), %rdi     # 0x12805e
callq 0x8510
leaq 0x5c959(%rip), %rdi     # 0x12692b
callq 0x82f0
cmpl $-0x1, %eax
je 0xca0e1
cmpw $0x0, 0x1600(%rbx)
jle 0xc9ff6
leaq 0x5e080(%rip), %rdi     # 0x128071
callq 0x8510
leaq 0x6f4(%rbx), %r14
leaq 0x26c(%rbx), %r12
cmpl $0x1, 0xcdc(%rbx)
jne 0xca142
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 0x5c957(%rip), %rdx     # 0x1269bc
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 0x5c8f0(%rip), %rdx     # 0x1269bc
movq %r14, %rcx
movq %r12, %r8
movq %r13, %r9
movb $0x5, %al
callq 0x8550
jmp 0xca24a
leaq 0x5c854(%rip), %rsi     # 0x12693c
leaq 0xef0(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x23f81(%rip), %rsi     # 0xee082
leaq 0x5c885(%rip), %rdx     # 0x12698d
leaq 0x6f0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x23f09(%rip), %rsi     # 0xee034
leaq 0x5c86c(%rip), %rdx     # 0x12699e
movq %rbx, %rdi
movl $0x185, %ecx            # imm = 0x185
movq %r15, %r8
jmp 0xca2bc
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 0x5c83e(%rip), %r13     # 0x1269f3
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 0xca2c8
leaq 0x5c7dc(%rip), %rsi     # 0x126a40
leaq 0xef0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x30af0
leaq 0x23e02(%rip), %rsi     # 0xee082
leaq 0x5c706(%rip), %rdx     # 0x12698d
leaq 0x6f0(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x23d8a(%rip), %rsi     # 0xee034
leaq 0x5c6ed(%rip), %rdx     # 0x12699e
movq %rbx, %rdi
movl $0x1af, %ecx            # imm = 0x1AF
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x16f8, %rsp           # imm = 0x16F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq