#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 log10(double);
double remlpord(double f1, double f2, double d1, double d2) {
  static double A1A3[3] = {5.309e-03, 7.114e-02, -4.761e-01};
  static double A4A6[3] = {-2.660e-03, -5.941e-01, -4.278e-01};
  d1 = log10(d1);
  d2 = log10(d2);
  double lh[3] = {d1 * d1, d1, 1};
  double DD1[3] = {0, 0, 0};
  for (int i = 0; i < 3; i++)
    DD1[i] = d2 * A1A3[i] + A4A6[i];
  double D = 0.0;
  for (int i = 0; i < 3; i++)
    D += DD1[i] * lh[i];
  double fK = 11.01217 + (d1 - d2) * 0.51244;
  double df = f2 - f1;
  return D / df - fK * df + 1;
}


x86 assembly (clang, -O0):
<remlpord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <log10@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <log10@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe82(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1030 <memset@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0x3,-0x64(%rbp)
jge    11e9 <remlpord+0xc9>
movsd  -0x20(%rbp),%xmm0
movslq -0x64(%rbp),%rcx
lea    0x2e8c(%rip),%rax
movsd  (%rax,%rcx,8),%xmm2
movslq -0x64(%rbp),%rcx
lea    0x2e9c(%rip),%rax
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movslq -0x64(%rbp),%rax
movsd  %xmm0,-0x60(%rbp,%rax,8)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    119a <remlpord+0x7a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
cmpl   $0x3,-0x74(%rbp)
jge    1236 <remlpord+0x116>
movslq -0x74(%rbp),%rax
movsd  -0x60(%rbp,%rax,8),%xmm0
movslq -0x74(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11f8 <remlpord+0xd8>
movsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  0xdc0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdbc(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm1
divsd  -0x88(%rbp),%xmm1
ff
movsd  -0x80(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xd50(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remlpord>:
sub    $0x28,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x18(%rsp)
movaps %xmm2,%xmm0
call   1030 <log10@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <log10@plt>
movapd %xmm0,%xmm1
movsd  0x8(%rsp),%xmm5
movapd %xmm5,%xmm0
mulsd  %xmm5,%xmm0
movsd  0xea7(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xea3(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  0xe9f(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xe9b(%rip),%xmm0
movsd  0xe9b(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  0xe97(%rip),%xmm3
xorpd  %xmm4,%xmm4
addsd  %xmm2,%xmm4
movapd %xmm5,%xmm2
mulsd  %xmm5,%xmm0
addsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
subsd  %xmm1,%xmm2
mulsd  0xe7b(%rip),%xmm2
addsd  0xe7b(%rip),%xmm2
movsd  0x20(%rsp),%xmm1
subsd  0x18(%rsp),%xmm1
divsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
addsd  0xe63(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
@remlpord.A1A3 = internal global [3 x double] [double 5.309000e-03, double 0x3FB2363B256FFC11, double -4.761000e-01]
@remlpord.A4A6 = internal global [3 x double] [double -2.660000e-03, double -5.941000e-01, double -4.278000e-01]
define double @remlpord(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca [3 x double]
%10 = alloca [3 x double]
%11 = alloca i32
%12 = alloca double
%13 = alloca i32
%14 = alloca double
%15 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%16 = load double, double* %7
%17 = call double @log10(double %16)
store double %17, double* %7
%18 = load double, double* %8
%19 = call double @log10(double %18)
store double %19, double* %8
%20 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%21 = load double, double* %7
%22 = load double, double* %7
%23 = fmul double %21, %22
store double %23, double* %20
%24 = getelementptr inbounds double, double* %20, i64 1
%25 = load double, double* %7
store double %25, double* %24
%26 = getelementptr inbounds double, double* %24, i64 1
store double 1.000000e+00, double* %26
%27 = bitcast [3 x double]* %10 to i8*
store i32 0, i32* %11
br label %28
28: ; preds = %45, %4
%29 = load i32, i32* %11
%30 = icmp slt i32 %29, 3
br i1 %30, label %31, label %48
31: ; preds = %28
%32 = load double, double* %8
%33 = load i32, i32* %11
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [3 x double], [3 x double]* @remlpord.A1A3, i64 0, i64 %34
%36 = load double, double* %35
%37 = load i32, i32* %11
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [3 x double], [3 x double]* @remlpord.A4A6, i64 0, i64 %38
%40 = load double, double* %39
%41 = call double @llvm.fmuladd.f64(double %32, double %36, double %40)
%42 = load i32, i32* %11
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 %43
store double %41, double* %44
br label %45
45: ; preds = %31
%46 = load i32, i32* %11
%47 = add nsw i32 %46, 1
store i32 %47, i32* %11
br label %28
48: ; preds = %28
store double 0.000000e+00, double* %12
store i32 0, i32* %13
br label %49
49: ; preds = %63, %48
%50 = load i32, i32* %13
%51 = icmp slt i32 %50, 3
br i1 %51, label %52, label %66
52: ; preds = %49
%53 = load i32, i32* %13
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [3 x double], [3 x double]* %10, i64 0, i64 %54
%56 = load double, double* %55
%57 = load i32, i32* %13
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 %58
%60 = load double, double* %59
%61 = load double, double* %12
%62 = call double @llvm.fmuladd.f64(double %56, double %60, double %61)
store double %62, double* %12
br label %63
63: ; preds = %52
%64 = load i32, i32* %13
%65 = add nsw i32 %64, 1
store i32 %65, i32* %13
br label %49
66: ; preds = %49
%67 = load double, double* %7
%68 = load double, double* %8
%69 = fsub double %67, %68
%70 = call double @llvm.fmuladd.f64(double %69, double 5.124400e-01, double 0x4026063B256FFC11)
store double %70, double* %14
%71 = load double, double* %6
%72 = load double, double* %5
%73 = fsub double %71, %72
store double %73, double* %15
%74 = load double, double* %12
%75 = load double, double* %15
%76 = fdiv double %74, %75
%77 = load double, double* %14
%78 = load double, double* %15
%79 = fneg double %77
%80 = call double @llvm.fmuladd.f64(double %79, double %78, double %76)
%81 = fadd double %80, 1.000000e+00
ret double %81
}

LLVM IR (-O2):
define double @remlpord(double %0, double %1, double %2, double %3) {
%5 = tail call double @log10(double %2)
%6 = tail call double @log10(double %3)
%7 = fmul double %5, %5
%8 = tail call double @llvm.fmuladd.f64(double %6, double 5.309000e-03, double -2.660000e-03)
%9 = tail call double @llvm.fmuladd.f64(double %6, double 0x3FB2363B256FFC11, double -5.941000e-01)
%10 = tail call double @llvm.fmuladd.f64(double %6, double -4.761000e-01, double -4.278000e-01)
%11 = tail call double @llvm.fmuladd.f64(double %8, double %7, double 0.000000e+00)
%12 = tail call double @llvm.fmuladd.f64(double %9, double %5, double %11)
%13 = fadd double %10, %12
%14 = fsub double %5, %6
%15 = tail call double @llvm.fmuladd.f64(double %14, double 5.124400e-01, double 0x4026063B256FFC11)
%16 = fsub double %1, %0
%17 = fdiv double %13, %16
%18 = fneg double %15
%19 = tail call double @llvm.fmuladd.f64(double %18, double %16, double %17)
%20 = fadd double %19, 1.000000e+00
ret double %20
}