#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*/ qd_div(double *, double *, double *);
int /*<<< orphan*/ qd_log(double const *, double *);
void qd_log10(const double *a, double *b) {
  const double qd_log10_0 = 2.302585092994045901e+00;
  const double qd_log10_1 = -2.170756223382249351e-16;
  const double qd_log10_2 = -9.984262454465776570e-33;
  const double qd_log10_3 = -4.023357454450206379e-49;
  double logten[4];
  logten[0] = qd_log10_0;
  logten[1] = qd_log10_1;
  logten[2] = qd_log10_2;
  logten[3] = qd_log10_3;
  qd_log(a, b);
  qd_div(b, logten, b);
}


x86 assembly (clang, -O0):
<qd_log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe82(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe6d(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <qd_log@plt>
mov    -0x10(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <qd_div@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_log10>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
movaps 0xed1(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
call   1030 <qd_log@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    %rbx,%rdx
call   1040 <qd_div@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @qd_log10(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca [4 x double]
store double* %0, double** %3
store double* %1, double** %4
store double 0x40026BB1BBB55516, double* %5
store double 0xBCAF48AD494EA3E9, double* %6
store double 0xB949EBAE3AE0260C, double* %7
store double 0xB5E2D10378BE1CF1, double* %8
%10 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 0
store double 0x40026BB1BBB55516, double* %10
%11 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 1
store double 0xBCAF48AD494EA3E9, double* %11
%12 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 2
store double 0xB949EBAE3AE0260C, double* %12
%13 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 3
store double 0xB5E2D10378BE1CF1, double* %13
%14 = load double*, double** %3
%15 = load double*, double** %4
%16 = call i32 @qd_log(double* %14, double* %15)
%17 = load double*, double** %4
%18 = getelementptr inbounds [4 x double], [4 x double]* %9, i64 0, i64 0
%19 = load double*, double** %4
%20 = call i32 @qd_div(double* %17, double* %18, double* %19)
ret void
}

LLVM IR (-O2):
define void @qd_log10(double* %0, double* %1) {
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %3 to i8*
%5 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%6 = bitcast [4 x double]* %3 to <2 x double>*
store <2 x double> <double 0x40026BB1BBB55516, double 0xBCAF48AD494EA3E9>, <2 x double>* %6
%7 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
%8 = bitcast double* %7 to <2 x double>*
store <2 x double> <double 0xB949EBAE3AE0260C, double 0xB5E2D10378BE1CF1>, <2 x double>* %8
%9 = tail call i32 @qd_log(double* %0, double* %1)
%10 = call i32 @qd_div(double* %1, double* %5, double* %1)
ret void
}