#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 */
int /*<<< orphan*/ reb_drift_kepu_stumpff(double, double *, double *, double *,
                                          double *);
void reb_drift_kepu_new(double *s, double dt0, double r0, double mu,
                        double alpha, double u, double *fp, double *c1,
                        double *c2, double *c3, int *iflag) {
  int nc;
  for (nc = 0; nc < 6; nc++) {
    double x = (*s) * (*s) * alpha;
    double c0;
    reb_drift_kepu_stumpff(x, &c0, c1, c2, c3);
    *c1 = (*c1) * (*s);
    *c2 = (*c2) * (*s) * (*s);
    *c3 = (*c3) * (*s) * (*s) * (*s);
    double f = r0 * (*c1) + u * (*c2) + mu * (*c3) - dt0;
    (*fp) = r0 * c0 + u * (*c1) + mu * (*c2);
    double fpp = (-r0 * alpha + mu) * (*c1) + u * c0;
    double fppp = (-r0 * alpha + mu) * c0 - u * alpha * (*c1);
    double ds = -f / (*fp);
    ds = -f / ((*fp) + ds * fpp / 2.);
    ds = -f / ((*fp) + ds * fpp / 2. + ds * ds * fppp / 6.);
    *s = (*s) + ds;
    double fdt = f / dt0;
    if (fdt * fdt < 1.e-13 * 1.e-13) {
      *iflag = 0;
      return;
    }
  }
  *iflag = 1;
}


x86 assembly (clang, -O0):
<reb_drift_kepu_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x48(%rbp)
mov    %r8,-0x50(%rbp)
mov    %r9,-0x58(%rbp)
movl   $0x0,-0x5c(%rbp)
cmpl   $0x6,-0x5c(%rbp)
jge    1483 <reb_drift_kepu_new+0x373>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x50(%rbp),%rcx
lea    -0x70(%rbp),%rdi
call   1030 <reb_drift_kepu_stumpff@plt>
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm1
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x30(%rbp),%xmm0
mov    -0x48(%rbp),%rax
mulsd  (%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm0
mov    -0x40(%rbp),%rax
mulsd  (%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x70(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mov    -0x40(%rbp),%rax
mulsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x38(%rbp),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x90(%rbp),%xmm2
ff
mulsd  -0x80(%rbp),%xmm2
movsd  0xc84(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x90(%rbp),%xmm2
ff
mulsd  -0x80(%rbp),%xmm2
movsd  0xc37(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
movsd  -0x90(%rbp),%xmm2
ff
mulsd  -0x90(%rbp),%xmm2
ff
mulsd  -0x88(%rbp),%xmm2
ff
movsd  0xc07(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x78(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm1
ff
mulsd  -0x98(%rbp),%xmm1
ff
movsd  0xba9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1470 <reb_drift_kepu_new+0x360>
mov    -0x58(%rbp),%rax
movl   $0x0,(%rax)
jmp    148d <reb_drift_kepu_new+0x37d>
jmp    1475 <reb_drift_kepu_new+0x365>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1153 <reb_drift_kepu_new+0x43>
mov    -0x58(%rbp),%rax
movl   $0x1,(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reb_drift_kepu_new>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,0x8(%rsp)
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %rsi,%r13
movsd  %xmm0,0x18(%rsp)
mov    %rdi,%rbp
movsd  %xmm1,0x20(%rsp)
movapd %xmm1,%xmm0
mulsd  %xmm3,%xmm0
movsd  %xmm2,0x28(%rsp)
subsd  %xmm0,%xmm2
movsd  %xmm2,0x10(%rsp)
movapd 0xea2(%rip),%xmm0
movapd %xmm4,0x50(%rsp)
xorpd  %xmm4,%xmm0
movsd  %xmm3,0x30(%rsp)
mulsd  %xmm3,%xmm0
movapd %xmm0,0x40(%rsp)
movsd  (%rdi),%xmm0
mov    $0x6,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mulsd  %xmm0,%xmm0
mulsd  0x30(%rsp),%xmm0
lea    0x38(%rsp),%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
call   1030 <reb_drift_kepu_stumpff@plt>
movsd  (%rbx),%xmm0
mulsd  0x0(%rbp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x0(%rbp),%xmm0
movsd  (%r12),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r12)
movsd  0x0(%rbp),%xmm0
movsd  (%r15),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r15)
movsd  (%rbx),%xmm2
movsd  (%r12),%xmm0
movapd %xmm0,%xmm3
movapd 0x50(%rsp),%xmm6
mulsd  %xmm6,%xmm3
movsd  0x20(%rsp),%xmm7
movapd %xmm7,%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm3,%xmm4
movsd  0x28(%rsp),%xmm5
mulsd  %xmm5,%xmm1
addsd  %xmm4,%xmm1
movsd  0x18(%rsp),%xmm8
subsd  %xmm8,%xmm1
movsd  0x38(%rsp),%xmm4
mulsd  %xmm6,%xmm2
movapd %xmm7,%xmm3
mulsd  %xmm4,%xmm3
addsd  %xmm2,%xmm3
mulsd  %xmm5,%xmm0
addsd  %xmm3,%xmm0
movsd  %xmm0,0x0(%r13)
movsd  (%rbx),%xmm2
movsd  0x10(%rsp),%xmm3
movapd %xmm3,%xmm5
mulsd  %xmm4,%xmm5
mulsd  %xmm6,%xmm4
mulsd  %xmm2,%xmm3
addsd  %xmm4,%xmm3
mulsd  0x40(%rsp),%xmm2
addsd  %xmm5,%xmm2
movapd %xmm1,%xmm4
divsd  %xmm0,%xmm4
mulsd  %xmm3,%xmm4
movsd  0xd7e(%rip),%xmm6
mulsd  %xmm6,%xmm4
movapd %xmm0,%xmm5
subsd  %xmm4,%xmm5
movapd %xmm1,%xmm4
xorpd  0xd56(%rip),%xmm4
divsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm3
mulsd  %xmm6,%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm4,%xmm4
mulsd  %xmm2,%xmm4
divsd  0xd4e(%rip),%xmm4
addsd  %xmm3,%xmm4
movapd %xmm1,%xmm2
divsd  %xmm4,%xmm2
movsd  0x0(%rbp),%xmm0
subsd  %xmm2,%xmm0
divsd  %xmm8,%xmm1
mulsd  %xmm1,%xmm1
movsd  0xd30(%rip),%xmm2
ucomisd %xmm1,%xmm2
movsd  %xmm0,0x0(%rbp)
ja     1312 <reb_drift_kepu_new+0x202>
add    $0xffffffff,%r14d
jne    1190 <reb_drift_kepu_new+0x80>
mov    0x8(%rsp),%rax
movl   $0x1,(%rax)
jmp    131d <reb_drift_kepu_new+0x20d>
mov    0x8(%rsp),%rax
movl   $0x0,(%rax)
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @reb_drift_kepu_new(double* %0, double %1, double %2, double %3, double %4, double %5, double* %6, double* %7, double* %8, double* %9, i32* %10) {
%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 i32*
%23 = alloca i32
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
store double* %0, double** %12
store double %1, double* %13
store double %2, double* %14
store double %3, double* %15
store double %4, double* %16
store double %5, double* %17
store double* %6, double** %18
store double* %7, double** %19
store double* %8, double** %20
store double* %9, double** %21
store i32* %10, i32** %22
store i32 0, i32* %23
br label %31
31: ; preds = %172, %11
%32 = load i32, i32* %23
%33 = icmp slt i32 %32, 6
br i1 %33, label %34, label %175
34: ; preds = %31
%35 = load double*, double** %12
%36 = load double, double* %35
%37 = load double*, double** %12
%38 = load double, double* %37
%39 = fmul double %36, %38
%40 = load double, double* %16
%41 = fmul double %39, %40
store double %41, double* %24
%42 = load double, double* %24
%43 = load double*, double** %19
%44 = load double*, double** %20
%45 = load double*, double** %21
%46 = call i32 @reb_drift_kepu_stumpff(double %42, double* %25, double* %43, double* %44, double* %45)
%47 = load double*, double** %19
%48 = load double, double* %47
%49 = load double*, double** %12
%50 = load double, double* %49
%51 = fmul double %48, %50
%52 = load double*, double** %19
store double %51, double* %52
%53 = load double*, double** %20
%54 = load double, double* %53
%55 = load double*, double** %12
%56 = load double, double* %55
%57 = fmul double %54, %56
%58 = load double*, double** %12
%59 = load double, double* %58
%60 = fmul double %57, %59
%61 = load double*, double** %20
store double %60, double* %61
%62 = load double*, double** %21
%63 = load double, double* %62
%64 = load double*, double** %12
%65 = load double, double* %64
%66 = fmul double %63, %65
%67 = load double*, double** %12
%68 = load double, double* %67
%69 = fmul double %66, %68
%70 = load double*, double** %12
%71 = load double, double* %70
%72 = fmul double %69, %71
%73 = load double*, double** %21
store double %72, double* %73
%74 = load double, double* %14
%75 = load double*, double** %19
%76 = load double, double* %75
%77 = load double, double* %17
%78 = load double*, double** %20
%79 = load double, double* %78
%80 = fmul double %77, %79
%81 = call double @llvm.fmuladd.f64(double %74, double %76, double %80)
%82 = load double, double* %15
%83 = load double*, double** %21
%84 = load double, double* %83
%85 = call double @llvm.fmuladd.f64(double %82, double %84, double %81)
%86 = load double, double* %13
%87 = fsub double %85, %86
store double %87, double* %26
%88 = load double, double* %14
%89 = load double, double* %25
%90 = load double, double* %17
%91 = load double*, double** %19
%92 = load double, double* %91
%93 = fmul double %90, %92
%94 = call double @llvm.fmuladd.f64(double %88, double %89, double %93)
%95 = load double, double* %15
%96 = load double*, double** %20
%97 = load double, double* %96
%98 = call double @llvm.fmuladd.f64(double %95, double %97, double %94)
%99 = load double*, double** %18
store double %98, double* %99
%100 = load double, double* %14
%101 = fneg double %100
%102 = load double, double* %16
%103 = load double, double* %15
%104 = call double @llvm.fmuladd.f64(double %101, double %102, double %103)
%105 = load double*, double** %19
%106 = load double, double* %105
%107 = load double, double* %17
%108 = load double, double* %25
%109 = fmul double %107, %108
%110 = call double @llvm.fmuladd.f64(double %104, double %106, double %109)
store double %110, double* %27
%111 = load double, double* %14
%112 = fneg double %111
%113 = load double, double* %16
%114 = load double, double* %15
%115 = call double @llvm.fmuladd.f64(double %112, double %113, double %114)
%116 = load double, double* %25
%117 = load double, double* %17
%118 = load double, double* %16
%119 = fmul double %117, %118
%120 = load double*, double** %19
%121 = load double, double* %120
%122 = fmul double %119, %121
%123 = fneg double %122
%124 = call double @llvm.fmuladd.f64(double %115, double %116, double %123)
store double %124, double* %28
%125 = load double, double* %26
%126 = fneg double %125
%127 = load double*, double** %18
%128 = load double, double* %127
%129 = fdiv double %126, %128
store double %129, double* %29
%130 = load double, double* %26
%131 = fneg double %130
%132 = load double*, double** %18
%133 = load double, double* %132
%134 = load double, double* %29
%135 = load double, double* %27
%136 = fmul double %134, %135
%137 = fdiv double %136, 2.000000e+00
%138 = fadd double %133, %137
%139 = fdiv double %131, %138
store double %139, double* %29
%140 = load double, double* %26
%141 = fneg double %140
%142 = load double*, double** %18
%143 = load double, double* %142
%144 = load double, double* %29
%145 = load double, double* %27
%146 = fmul double %144, %145
%147 = fdiv double %146, 2.000000e+00
%148 = fadd double %143, %147
%149 = load double, double* %29
%150 = load double, double* %29
%151 = fmul double %149, %150
%152 = load double, double* %28
%153 = fmul double %151, %152
%154 = fdiv double %153, 6.000000e+00
%155 = fadd double %148, %154
%156 = fdiv double %141, %155
store double %156, double* %29
%157 = load double*, double** %12
%158 = load double, double* %157
%159 = load double, double* %29
%160 = fadd double %158, %159
%161 = load double*, double** %12
store double %160, double* %161
%162 = load double, double* %26
%163 = load double, double* %13
%164 = fdiv double %162, %163
store double %164, double* %30
%165 = load double, double* %30
%166 = load double, double* %30
%167 = fmul double %165, %166
%168 = fcmp olt double %167, 1.000000e-26
br i1 %168, label %169, label %171
169: ; preds = %34
%170 = load i32*, i32** %22
store i32 0, i32* %170
br label %177
171: ; preds = %34
br label %172
172: ; preds = %171
%173 = load i32, i32* %23
%174 = add nsw i32 %173, 1
store i32 %174, i32* %23
br label %31
175: ; preds = %31
%176 = load i32*, i32** %22
store i32 1, i32* %176
br label %177
177: ; preds = %175, %169
ret void
}

LLVM IR (-O2):
define void @reb_drift_kepu_new(double* nocapture %0, double %1, double %2, double %3, double %4, double %5, double* nocapture writeonly %6, double* %7, double* %8, double* %9, i32* nocapture writeonly %10) {
%12 = alloca double
%13 = bitcast double* %12 to i8*
%14 = fneg double %2
%15 = call double @llvm.fmuladd.f64(double %14, double %4, double %3)
%16 = fneg double %5
%17 = fmul double %16, %4
%18 = load double, double* %0
br label %19
19: ; preds = %11, %72
%20 = phi double [ %18, %11 ], [ %67, %72 ]
%21 = phi i32 [ 0, %11 ], [ %73, %72 ]
%22 = fmul double %20, %20
%23 = fmul double %22, %4
%24 = call i32 @reb_drift_kepu_stumpff(double %23, double* %12, double* %7, double* %8, double* %9)
%25 = load double, double* %7
%26 = load double, double* %0
%27 = fmul double %25, %26
store double %27, double* %7
%28 = load double, double* %8
%29 = load double, double* %0
%30 = fmul double %28, %29
%31 = fmul double %29, %30
store double %31, double* %8
%32 = load double, double* %9
%33 = load double, double* %0
%34 = fmul double %32, %33
%35 = fmul double %33, %34
%36 = fmul double %33, %35
store double %36, double* %9
%37 = load double, double* %7
%38 = load double, double* %8
%39 = fmul double %38, %5
%40 = call double @llvm.fmuladd.f64(double %2, double %37, double %39)
%41 = call double @llvm.fmuladd.f64(double %3, double %36, double %40)
%42 = fsub double %41, %1
%43 = load double, double* %12
%44 = fmul double %37, %5
%45 = call double @llvm.fmuladd.f64(double %2, double %43, double %44)
%46 = call double @llvm.fmuladd.f64(double %3, double %38, double %45)
store double %46, double* %6
%47 = load double, double* %7
%48 = fmul double %43, %5
%49 = call double @llvm.fmuladd.f64(double %15, double %47, double %48)
%50 = fmul double %17, %47
%51 = call double @llvm.fmuladd.f64(double %15, double %43, double %50)
%52 = fneg double %42
%53 = fdiv double %52, %46
%54 = fmul double %49, %53
%55 = fmul double %54, 5.000000e-01
%56 = fadd double %46, %55
%57 = fdiv double %52, %56
%58 = fmul double %49, %57
%59 = fmul double %58, 5.000000e-01
%60 = fadd double %46, %59
%61 = fmul double %57, %57
%62 = fmul double %51, %61
%63 = fdiv double %62, 6.000000e+00
%64 = fadd double %60, %63
%65 = load double, double* %0
%66 = fdiv double %42, %64
%67 = fsub double %65, %66
store double %67, double* %0
%68 = fdiv double %42, %1
%69 = fmul double %68, %68
%70 = fcmp olt double %69, 1.000000e-26
br i1 %70, label %71, label %72
71: ; preds = %19
store i32 0, i32* %10
br label %76
72: ; preds = %19
%73 = add nuw nsw i32 %21, 1
%74 = icmp eq i32 %73, 6
br i1 %74, label %75, label %19
75: ; preds = %72
store i32 1, i32* %10
br label %76
76: ; preds = %71, %75
ret void
}