#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double log(int);
void gcor2(double a, double a1, double b1, double b2, double b3, double b4,
           double rtrs, double *gg, double *ggrs) {
  double q0, q1, q2, q3;
  q0 = a * -2. * (a1 * rtrs * rtrs + 1.);
  q1 = a * 2. * rtrs * (b1 + rtrs * (b2 + rtrs * (b3 + b4 * rtrs)));
  q2 = log(1. / q1 + 1.);
  *gg = q0 * q2;
  q3 = a * (b1 / rtrs + b2 * 2. + rtrs * (b3 * 3. + b4 * 4. * rtrs));
  *ggrs = a * -2. * a1 * q2 - q0 * q3 / (q1 * (q1 + 1.));
}


x86 assembly (clang, -O0):
<gcor2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
mov    %rdi,-0x40(%rbp)
mov    %rsi,-0x48(%rbp)
movsd  0xebd(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe95(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xea0(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm4
movsd  -0x38(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm6
movsd  -0x30(%rbp),%xmm5
movsd  -0x38(%rbp),%xmm7
mulsd  %xmm7,%xmm5
addsd  %xmm6,%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe2a(%rip),%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  0xe1d(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
divsd  -0x38(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
addsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x38(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm3
movsd  0xde3(%rip),%xmm4
mulsd  -0x30(%rbp),%xmm4
mulsd  -0x38(%rbp),%xmm4
movsd  0xdc9(%rip),%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xda0(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm3
movsd  0xd72(%rip),%xmm4
addsd  -0x58(%rbp),%xmm4
mulsd  %xmm4,%xmm3
divsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcor2>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm5,0x28(%rsp)
movsd  %xmm4,0x30(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x50(%rsp)
movsd  %xmm0,0x40(%rsp)
movsd  0xeb7(%rip),%xmm7
mulsd  %xmm0,%xmm7
movsd  %xmm7,0x48(%rsp)
movsd  %xmm6,0x10(%rsp)
mulsd  %xmm6,%xmm1
mulsd  %xmm6,%xmm1
movsd  0xe9e(%rip),%xmm8
addsd  %xmm8,%xmm1
mulsd  %xmm7,%xmm1
movsd  %xmm1,0x20(%rsp)
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm6,%xmm1
movapd %xmm5,%xmm7
mulsd  %xmm6,%xmm7
addsd  %xmm4,%xmm7
mulsd  %xmm6,%xmm7
addsd  %xmm3,%xmm7
mulsd  %xmm6,%xmm7
addsd  %xmm2,%xmm7
mulsd  %xmm1,%xmm7
movsd  %xmm7,0x38(%rsp)
movapd %xmm8,%xmm0
divsd  %xmm7,%xmm0
addsd  %xmm8,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  0x20(%rsp),%xmm4
movapd %xmm4,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm5
divsd  %xmm5,%xmm2
movsd  0x18(%rsp),%xmm1
addsd  %xmm1,%xmm1
movsd  0x28(%rsp),%xmm3
mulsd  0xe14(%rip),%xmm3
addsd  %xmm2,%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm5,%xmm3
movsd  0x30(%rsp),%xmm1
mulsd  0xe02(%rip),%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm5,%xmm1
addsd  %xmm2,%xmm1
mulsd  0x40(%rsp),%xmm1
movsd  0x48(%rsp),%xmm2
mulsd  0x50(%rsp),%xmm2
movsd  0xdcc(%rip),%xmm3
movsd  0x38(%rsp),%xmm5
addsd  %xmm5,%xmm3
mulsd  %xmm5,%xmm3
mulsd  %xmm4,%xmm1
divsd  %xmm3,%xmm1
mulsd  %xmm0,%xmm2
subsd  %xmm1,%xmm2
movsd  %xmm2,(%r14)
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @gcor2(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double* %7, double* %8) {
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double*
%18 = alloca double*
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double %6, double* %16
store double* %7, double** %17
store double* %8, double** %18
%23 = load double, double* %10
%24 = fmul double %23, -2.000000e+00
%25 = load double, double* %11
%26 = load double, double* %16
%27 = fmul double %25, %26
%28 = load double, double* %16
%29 = call double @llvm.fmuladd.f64(double %27, double %28, double 1.000000e+00)
%30 = fmul double %24, %29
store double %30, double* %19
%31 = load double, double* %10
%32 = fmul double %31, 2.000000e+00
%33 = load double, double* %16
%34 = fmul double %32, %33
%35 = load double, double* %12
%36 = load double, double* %16
%37 = load double, double* %13
%38 = load double, double* %16
%39 = load double, double* %14
%40 = load double, double* %15
%41 = load double, double* %16
%42 = call double @llvm.fmuladd.f64(double %40, double %41, double %39)
%43 = call double @llvm.fmuladd.f64(double %38, double %42, double %37)
%44 = call double @llvm.fmuladd.f64(double %36, double %43, double %35)
%45 = fmul double %34, %44
store double %45, double* %20
%46 = load double, double* %20
%47 = fdiv double 1.000000e+00, %46
%48 = fadd double %47, 1.000000e+00
%49 = fptosi double %48 to i32
%50 = call double @log(i32 %49)
store double %50, double* %21
%51 = load double, double* %19
%52 = load double, double* %21
%53 = fmul double %51, %52
%54 = load double*, double** %17
store double %53, double* %54
%55 = load double, double* %10
%56 = load double, double* %12
%57 = load double, double* %16
%58 = fdiv double %56, %57
%59 = load double, double* %13
%60 = call double @llvm.fmuladd.f64(double %59, double 2.000000e+00, double %58)
%61 = load double, double* %16
%62 = load double, double* %14
%63 = load double, double* %15
%64 = fmul double %63, 4.000000e+00
%65 = load double, double* %16
%66 = fmul double %64, %65
%67 = call double @llvm.fmuladd.f64(double %62, double 3.000000e+00, double %66)
%68 = call double @llvm.fmuladd.f64(double %61, double %67, double %60)
%69 = fmul double %55, %68
store double %69, double* %22
%70 = load double, double* %10
%71 = fmul double %70, -2.000000e+00
%72 = load double, double* %11
%73 = fmul double %71, %72
%74 = load double, double* %21
%75 = load double, double* %19
%76 = load double, double* %22
%77 = fmul double %75, %76
%78 = load double, double* %20
%79 = load double, double* %20
%80 = fadd double %79, 1.000000e+00
%81 = fmul double %78, %80
%82 = fdiv double %77, %81
%83 = fneg double %82
%84 = call double @llvm.fmuladd.f64(double %73, double %74, double %83)
%85 = load double*, double** %18
store double %84, double* %85
ret void
}

LLVM IR (-O2):
define void @gcor2(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double* nocapture writeonly %7, double* nocapture writeonly %8) {
%10 = fmul double %0, -2.000000e+00
%11 = fmul double %1, %6
%12 = tail call double @llvm.fmuladd.f64(double %11, double %6, double 1.000000e+00)
%13 = fmul double %10, %12
%14 = fmul double %0, 2.000000e+00
%15 = fmul double %14, %6
%16 = tail call double @llvm.fmuladd.f64(double %5, double %6, double %4)
%17 = tail call double @llvm.fmuladd.f64(double %6, double %16, double %3)
%18 = tail call double @llvm.fmuladd.f64(double %6, double %17, double %2)
%19 = fmul double %15, %18
%20 = fdiv double 1.000000e+00, %19
%21 = fadd double %20, 1.000000e+00
%22 = fptosi double %21 to i32
%23 = tail call double @log(i32 %22)
%24 = fmul double %13, %23
store double %24, double* %7
%25 = fdiv double %2, %6
%26 = tail call double @llvm.fmuladd.f64(double %3, double 2.000000e+00, double %25)
%27 = fmul double %5, 4.000000e+00
%28 = fmul double %27, %6
%29 = tail call double @llvm.fmuladd.f64(double %4, double 3.000000e+00, double %28)
%30 = tail call double @llvm.fmuladd.f64(double %6, double %29, double %26)
%31 = fmul double %30, %0
%32 = fmul double %10, %1
%33 = fadd double %19, 1.000000e+00
%34 = fmul double %19, %33
%35 = fneg double %13
%36 = fmul double %31, %35
%37 = fdiv double %36, %34
%38 = tail call double @llvm.fmuladd.f64(double %32, double %23, double %37)
store double %38, double* %8
ret void
}