// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../external/HMcode/hmcode.c
// Function: hmcode
int hmcode(
           struct precision *ppr,
           struct background *pba,
           struct perturbations *ppt,
           struct primordial *ppm,
           struct fourier *pfo,
           int index_pk,
           int index_tau,
           double tau,
           double *pk_nl,
           double **lnpk_l,
           double **ddlnpk_l,
           double *k_nl,
           short *nl_corr_not_computable_at_this_k,
           struct hmcode_workspace * phw
           ) {

  double *pk_nl_baseline;
  double *pk_nl_denominator;
  int index_k;

  /* The baryonic contribution is calculated as the ratio of three different
     simpler models, which are computed below
     (baryonic/unfitted_nobaryons * nobaryons) */
  if (pfo->hm_version == hmcode_version_2020_baryonic) {

    class_call(hmcode_compute(ppr, pba, ppt, ppm, pfo,
                              index_pk, index_tau, tau,
                              pk_nl, lnpk_l, ddlnpk_l,
                              k_nl, nl_corr_not_computable_at_this_k,
                              phw),
               pfo->error_message,
               pfo->error_message);

    class_alloc(pk_nl_baseline,
                pfo->k_size*sizeof(double),
                pfo->error_message);

    pfo->hm_version = hmcode_version_2020;

    class_call(hmcode_compute(ppr, pba, ppt, ppm, pfo,
                              index_pk, index_tau, tau,
                              pk_nl_baseline, lnpk_l, ddlnpk_l,
                              k_nl, nl_corr_not_computable_at_this_k,
                              phw),
               pfo->error_message,
               pfo->error_message);

    pfo->hm_version = hmcode_version_2020_unfitted;

    class_alloc(pk_nl_denominator,
                pfo->k_size*sizeof(double),
                pfo->error_message);

    class_call(hmcode_compute(ppr, pba, ppt, ppm, pfo,
                              index_pk, index_tau, tau,
                              pk_nl_denominator, lnpk_l, ddlnpk_l,
                              k_nl, nl_corr_not_computable_at_this_k,
                              phw),
               pfo->error_message,
               pfo->error_message);

    pfo->hm_version = hmcode_version_2020_baryonic;

    for(index_k=0;index_k<pfo->k_size;++index_k){
      pk_nl[index_k] = pk_nl[index_k] * pk_nl_baseline[index_k] / pk_nl_denominator[index_k];
    }

    free(pk_nl_baseline);
    free(pk_nl_denominator);
  }
  else { //In this case we can do the normal analysis
    class_call(hmcode_compute(ppr, pba, ppt, ppm, pfo,
                              index_pk, index_tau, tau,
                              pk_nl, lnpk_l, ddlnpk_l,
                              k_nl, nl_corr_not_computable_at_this_k,
                              phw),
               pfo->error_message,
               pfo->error_message);
  }

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x30b8, %rsp           # imm = 0x30B8
movq 0x3110(%rsp), %rax
movq 0x3108(%rsp), %rax
movq 0x3100(%rsp), %rax
movq 0x30f8(%rsp), %rax
movq 0x30f0(%rsp), %rax
movq 0x30e8(%rsp), %rax
movl 0x30e0(%rsp), %eax
movq %rdi, 0x30a8(%rsp)
movq %rsi, 0x30a0(%rsp)
movq %rdx, 0x3098(%rsp)
movq %rcx, 0x3090(%rsp)
movq %r8, 0x3088(%rsp)
movl %r9d, 0x3084(%rsp)
movsd %xmm0, 0x3078(%rsp)
movq 0x3088(%rsp), %rax
cmpl $0x3, 0xc(%rax)
jne 0x1b7d21
movq 0x30a8(%rsp), %rdi
movq 0x30a0(%rsp), %rsi
movq 0x3098(%rsp), %rdx
movq 0x3090(%rsp), %rcx
movq 0x3088(%rsp), %r8
movl 0x3084(%rsp), %r9d
movl 0x30e0(%rsp), %ebp
movsd 0x3078(%rsp), %xmm0
movq 0x30e8(%rsp), %r15
movq 0x30f0(%rsp), %r14
movq 0x30f8(%rsp), %rbx
movq 0x3100(%rsp), %r11
movq 0x3108(%rsp), %r10
movq 0x3110(%rsp), %rax
movl %ebp, (%rsp)
movq %r15, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x1b7e50
cmpl $0x1, %eax
jne 0x1b78f7
leaq 0x2860(%rsp), %rdi
movq 0x3088(%rsp), %rcx
addq $0x192, %rcx            # imm = 0x192
leaq 0x1ab30(%rip), %rsi     # 0x1d23d8
leaq 0x58ed2(%rip), %rdx     # 0x210781
movb $0x0, %al
callq 0x5b9c0
movq 0x3088(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x2860(%rsp), %r8
leaq 0x1a760(%rip), %rsi     # 0x1d2034
leaq 0x2feba(%rip), %rdx     # 0x1e7795
movl $0x42, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x30b4(%rsp)
jmp 0x1b7e2d
movq 0x3088(%rsp), %rax
movslq 0x6c(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x3070(%rsp)
cmpq $0x0, 0x3070(%rsp)
jne 0x1b799b
movq 0x3088(%rsp), %rax
movslq 0x6c(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x285c(%rsp)
leaq 0x2050(%rsp), %rdi
movl 0x285c(%rsp), %ecx
leaq 0x1a6b8(%rip), %rsi     # 0x1d2004
leaq 0x58eb6(%rip), %rdx     # 0x210809
movb $0x0, %al
callq 0x5b9c0
movq 0x3088(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x2050(%rsp), %r8
leaq 0x1a6bc(%rip), %rsi     # 0x1d2034
leaq 0x2fe16(%rip), %rdx     # 0x1e7795
movl $0x46, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x30b4(%rsp)
jmp 0x1b7e2d
movq 0x3088(%rsp), %rax
movl $0x1, 0xc(%rax)
movq 0x30a8(%rsp), %rdi
movq 0x30a0(%rsp), %rsi
movq 0x3098(%rsp), %rdx
movq 0x3090(%rsp), %rcx
movq 0x3088(%rsp), %r8
movl 0x3084(%rsp), %r9d
movl 0x30e0(%rsp), %ebp
movsd 0x3078(%rsp), %xmm0
movq 0x3070(%rsp), %r15
movq 0x30f0(%rsp), %r14
movq 0x30f8(%rsp), %rbx
movq 0x3100(%rsp), %r11
movq 0x3108(%rsp), %r10
movq 0x3110(%rsp), %rax
movl %ebp, (%rsp)
movq %r15, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x1b7e50
cmpl $0x1, %eax
jne 0x1b7ab2
leaq 0x1850(%rsp), %rdi
movq 0x3088(%rsp), %rcx
addq $0x192, %rcx            # imm = 0x192
leaq 0x1a975(%rip), %rsi     # 0x1d23d8
leaq 0x58dae(%rip), %rdx     # 0x210818
movb $0x0, %al
callq 0x5b9c0
movq 0x3088(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x1850(%rsp), %r8
leaq 0x1a5a5(%rip), %rsi     # 0x1d2034
leaq 0x2fcff(%rip), %rdx     # 0x1e7795
movl $0x50, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x30b4(%rsp)
jmp 0x1b7e2d
movq 0x3088(%rsp), %rax
movl $0x2, 0xc(%rax)
movq 0x3088(%rsp), %rax
movslq 0x6c(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x3068(%rsp)
cmpq $0x0, 0x3068(%rsp)
jne 0x1b7b65
movq 0x3088(%rsp), %rax
movslq 0x6c(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x184c(%rsp)
leaq 0x1040(%rsp), %rdi
movl 0x184c(%rsp), %ecx
leaq 0x1a4ee(%rip), %rsi     # 0x1d2004
leaq 0x58d8c(%rip), %rdx     # 0x2108a9
movb $0x0, %al
callq 0x5b9c0
movq 0x3088(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x1040(%rsp), %r8
leaq 0x1a4f2(%rip), %rsi     # 0x1d2034
leaq 0x2fc4c(%rip), %rdx     # 0x1e7795
movl $0x56, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x30b4(%rsp)
jmp 0x1b7e2d
movq 0x30a8(%rsp), %rdi
movq 0x30a0(%rsp), %rsi
movq 0x3098(%rsp), %rdx
movq 0x3090(%rsp), %rcx
movq 0x3088(%rsp), %r8
movl 0x3084(%rsp), %r9d
movl 0x30e0(%rsp), %ebp
movsd 0x3078(%rsp), %xmm0
movq 0x3068(%rsp), %r15
movq 0x30f0(%rsp), %r14
movq 0x30f8(%rsp), %rbx
movq 0x3100(%rsp), %r11
movq 0x3108(%rsp), %r10
movq 0x3110(%rsp), %rax
movl %ebp, (%rsp)
movq %r15, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x1b7e50
cmpl $0x1, %eax
jne 0x1b7c6d
leaq 0x840(%rsp), %rdi
movq 0x3088(%rsp), %rcx
addq $0x192, %rcx            # imm = 0x192
leaq 0x1a7ba(%rip), %rsi     # 0x1d23d8
leaq 0x58c96(%rip), %rdx     # 0x2108bb
movb $0x0, %al
callq 0x5b9c0
movq 0x3088(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x840(%rsp), %r8
leaq 0x1a3ea(%rip), %rsi     # 0x1d2034
leaq 0x2fb44(%rip), %rdx     # 0x1e7795
movl $0x5e, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x30b4(%rsp)
jmp 0x1b7e2d
movq 0x3088(%rsp), %rax
movl $0x3, 0xc(%rax)
movl $0x0, 0x3064(%rsp)
movl 0x3064(%rsp), %eax
movq 0x3088(%rsp), %rcx
cmpl 0x6c(%rcx), %eax
jge 0x1b7d02
movq 0x30e8(%rsp), %rax
movslq 0x3064(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x3070(%rsp), %rax
movslq 0x3064(%rsp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movq 0x3068(%rsp), %rax
movslq 0x3064(%rsp), %rcx
divsd (%rax,%rcx,8), %xmm0
movq 0x30e8(%rsp), %rax
movslq 0x3064(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x3064(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3064(%rsp)
jmp 0x1b7c87
movq 0x3070(%rsp), %rdi
callq 0x8420
movq 0x3068(%rsp), %rdi
callq 0x8420
jmp 0x1b7e22
movq 0x30a8(%rsp), %rdi
movq 0x30a0(%rsp), %rsi
movq 0x3098(%rsp), %rdx
movq 0x3090(%rsp), %rcx
movq 0x3088(%rsp), %r8
movl 0x3084(%rsp), %r9d
movl 0x30e0(%rsp), %ebp
movsd 0x3078(%rsp), %xmm0
movq 0x30e8(%rsp), %r15
movq 0x30f0(%rsp), %r14
movq 0x30f8(%rsp), %rbx
movq 0x3100(%rsp), %r11
movq 0x3108(%rsp), %r10
movq 0x3110(%rsp), %rax
movl %ebp, (%rsp)
movq %r15, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq %rbx, 0x18(%rsp)
movq %r11, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x1b7e50
cmpl $0x1, %eax
jne 0x1b7e20
leaq 0x40(%rsp), %rdi
movq 0x3088(%rsp), %rcx
addq $0x192, %rcx            # imm = 0x192
leaq 0x1a601(%rip), %rsi     # 0x1d23d8
leaq 0x589a3(%rip), %rdx     # 0x210781
movb $0x0, %al
callq 0x5b9c0
movq 0x3088(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x40(%rsp), %r8
leaq 0x1a234(%rip), %rsi     # 0x1d2034
leaq 0x2f98e(%rip), %rdx     # 0x1e7795
movl $0x70, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x30b4(%rsp)
jmp 0x1b7e2d
jmp 0x1b7e22
movl $0x0, 0x30b4(%rsp)
movl 0x30b4(%rsp), %eax
addq $0x30b8, %rsp           # imm = 0x30B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)