// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/transfer.c
// Function: transfer_source_resample
int transfer_source_resample(
                             struct precision * ppr,
                             struct background * pba,
                             struct perturbations * ppt,
                             struct transfer * ptr,
                             int bin,
                             double * tau0_minus_tau,
                             int tau_size,
                             int index_md,
                             double tau0,
                             double * interpolated_sources,
                             double * sources) {

  /* running index on time */
  int index_tau;

  /* array of values of source */
  double * source_at_tau;

  /* array of source values for a given time and for all k's */
  class_alloc(source_at_tau,
              sizeof(double),
              ptr->error_message);

  /* interpolate the sources linearly at the new time values */
  for (index_tau=0; index_tau<tau_size; index_tau++) {

    class_call(array_interpolate_two(ppt->tau_sampling,
                                     1,
                                     0,
                                     interpolated_sources,
                                     1,
                                     ppt->tau_size,
                                     tau0-tau0_minus_tau[index_tau],
                                     source_at_tau,
                                     1,
                                     ptr->error_message),
               ptr->error_message,
               ptr->error_message);

    /* copy the new values in the output sources array */
    sources[index_tau] = source_at_tau[0];
  }

  /* deallocate the temporary array */
  free(source_at_tau);

  return _SUCCESS_;

}

// Assembly:
subq $0x1078, %rsp           # imm = 0x1078
movq 0x1098(%rsp), %rax
movq 0x1090(%rsp), %rax
movl 0x1088(%rsp), %eax
movl 0x1080(%rsp), %eax
movq %rdi, 0x1068(%rsp)
movq %rsi, 0x1060(%rsp)
movq %rdx, 0x1058(%rsp)
movq %rcx, 0x1050(%rsp)
movl %r8d, 0x104c(%rsp)
movq %r9, 0x1040(%rsp)
movsd %xmm0, 0x1038(%rsp)
movl $0x8, %edi
callq 0x8460
movq %rax, 0x1028(%rsp)
cmpq $0x0, 0x1028(%rsp)
jne 0x1417cb
movl $0x8, 0x1024(%rsp)
leaq 0x820(%rsp), %rdi
movl 0x1024(%rsp), %ecx
leaq 0x90888(%rip), %rsi     # 0x1d2004
leaq 0xc27c5(%rip), %rdx     # 0x203f48
movb $0x0, %al
callq 0x5b9c0
movq 0x1050(%rsp), %rdi
addq $0x96a, %rdi            # imm = 0x96A
leaq 0x820(%rsp), %r8
leaq 0x9088c(%rip), %rsi     # 0x1d2034
leaq 0xc27a7(%rip), %rdx     # 0x203f56
movl $0xba2, %ecx            # imm = 0xBA2
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1074(%rsp)
jmp 0x14191d
movl $0x0, 0x1034(%rsp)
movl 0x1034(%rsp), %eax
cmpl 0x1080(%rsp), %eax
jge 0x141905
movq 0x1058(%rsp), %rax
movq 0x9f0(%rax), %rdi
movq 0x1090(%rsp), %rcx
movq 0x1058(%rsp), %rax
movl 0x9f8(%rax), %r9d
movsd 0x1038(%rsp), %xmm0
movq 0x1040(%rsp), %rax
movslq 0x1034(%rsp), %rdx
subsd (%rax,%rdx,8), %xmm0
movq 0x1028(%rsp), %r10
movq 0x1050(%rsp), %rax
addq $0x96a, %rax            # imm = 0x96A
movl $0x1, %r8d
xorl %edx, %edx
movl %r8d, %esi
movq %r10, (%rsp)
movl $0x1, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x28200
cmpl $0x1, %eax
jne 0x1418ce
leaq 0x20(%rsp), %rdi
movq 0x1050(%rsp), %rcx
addq $0x96a, %rcx            # imm = 0x96A
leaq 0x90b53(%rip), %rsi     # 0x1d23d8
leaq 0xc26e3(%rip), %rdx     # 0x203f6f
movb $0x0, %al
callq 0x5b9c0
movq 0x1050(%rsp), %rdi
addq $0x96a, %rdi            # imm = 0x96A
leaq 0x20(%rsp), %r8
leaq 0x90786(%rip), %rsi     # 0x1d2034
leaq 0xc26a1(%rip), %rdx     # 0x203f56
movl $0xbb2, %ecx            # imm = 0xBB2
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1074(%rsp)
jmp 0x14191d
movq 0x1028(%rsp), %rax
movsd (%rax), %xmm0
movq 0x1098(%rsp), %rax
movslq 0x1034(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x1034(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1034(%rsp)
jmp 0x1417d6
movq 0x1028(%rsp), %rdi
callq 0x8420
movl $0x0, 0x1074(%rsp)
movl 0x1074(%rsp), %eax
addq $0x1078, %rsp           # imm = 0x1078
retq
nopl (%rax)