#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 M_PI;
double cos(int);
double log(double);
double sin(int);
int /*<<< orphan*/ sine_cosine_integrals(int, double *, double *);
void dipole_resistance(double l_lambda, double l_a, double *r11, double *x11) {
  double bl, ln_bl, ln_2bl, sin_2bl, cos_2bl;
  double si_2bl, si_4bl, ci_2bl, ci_4bl, ln_l_a;
  bl = 2 * M_PI * l_lambda;
  ln_bl = log(bl);
  ln_2bl = log(2 * bl);
  sin_2bl = sin(2 * bl);
  cos_2bl = cos(2 * bl);
  sine_cosine_integrals(2 * bl, &si_2bl, &ci_2bl);
  sine_cosine_integrals(4 * bl, &si_4bl, &ci_4bl);
  ln_l_a = log(l_a);
  *r11 = 30 *
         (2 * (0.577215664901532860606512 + ln_2bl - ci_2bl) +
          sin_2bl * (si_4bl - 2 * si_2bl) +
          cos_2bl * (0.577215664901532860606512 + ln_bl + ci_4bl - 2 * ci_2bl));
  *x11 = 30 * (2 * si_2bl +
               sin_2bl * (0.577215664901532860606512 + ln_bl + ci_4bl -
                          2 * ci_2bl - 2 * ln_l_a) +
               cos_2bl * (-si_4bl + 2 * si_2bl));
}


x86 assembly (clang, -O0):
<dipole_resistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  0xe8d(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xe76(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  0xe5b(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <cos@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  0xe40(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%edi
lea    -0x50(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1040 <sine_cosine_integrals@plt>
movsd  0xe1a(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%edi
lea    -0x58(%rbp),%rsi
lea    -0x68(%rbp),%rdx
call   1040 <sine_cosine_integrals@plt>
movsd  -0x10(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  0xde5(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm3
addsd  %xmm3,%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  0xdab(%rip),%xmm2
addsd  -0x30(%rbp),%xmm2
addsd  -0x68(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
addsd  %xmm3,%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xd7c(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  0xd66(%rip),%xmm2
addsd  -0x30(%rbp),%xmm2
addsd  -0x68(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
addsd  %xmm3,%xmm3
subsd  %xmm3,%xmm2
movsd  -0x70(%rbp),%xmm3
addsd  %xmm3,%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
movsd  -0x50(%rbp),%xmm2
addsd  %xmm2,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xcf0(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dipole_resistance>:
push   %rbp
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm1,0x20(%rsp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1060 <log@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
call   1060 <log@plt>
movsd  %xmm0,0x10(%rsp)
cvttsd2si (%rsp),%ebp
mov    %ebp,%edi
call   1030 <sin@plt>
movsd  %xmm0,0x18(%rsp)
mov    %ebp,%edi
call   1050 <cos@plt>
movsd  %xmm0,(%rsp)
lea    0x48(%rsp),%rsi
lea    0x38(%rsp),%rdx
mov    %ebp,%edi
call   1040 <sine_cosine_integrals@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xe2a(%rip),%xmm0
cvttsd2si %xmm0,%edi
lea    0x40(%rsp),%rsi
lea    0x30(%rsp),%rdx
call   1040 <sine_cosine_integrals@plt>
movsd  0x20(%rsp),%xmm0
call   1060 <log@plt>
movsd  0xe0c(%rip),%xmm3
movsd  0x10(%rsp),%xmm6
addsd  %xmm3,%xmm6
movsd  0x38(%rsp),%xmm4
subsd  %xmm4,%xmm6
movsd  0x40(%rsp),%xmm8
movsd  0x48(%rsp),%xmm1
addsd  %xmm1,%xmm1
movapd %xmm8,%xmm5
subsd  %xmm1,%xmm5
movsd  0x18(%rsp),%xmm7
mulsd  %xmm7,%xmm5
addsd  %xmm6,%xmm6
addsd  %xmm5,%xmm6
movapd %xmm6,%xmm2
movsd  0x28(%rsp),%xmm5
addsd  %xmm3,%xmm5
addsd  0x30(%rsp),%xmm5
addsd  %xmm4,%xmm4
subsd  %xmm4,%xmm5
movsd  (%rsp),%xmm6
movapd %xmm6,%xmm3
mulsd  %xmm5,%xmm3
addsd  %xmm2,%xmm3
movsd  0xd9f(%rip),%xmm4
mulsd  %xmm4,%xmm3
movsd  %xmm3,(%rbx)
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm5
mulsd  %xmm7,%xmm5
addsd  %xmm1,%xmm5
subsd  %xmm8,%xmm1
mulsd  %xmm6,%xmm1
addsd  %xmm5,%xmm1
mulsd  %xmm4,%xmm1
movsd  %xmm1,(%r14)
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@M_PI = global i32 0
define void @dipole_resistance(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = bitcast double* %5 to i8*
%10 = bitcast double* %6 to i8*
%11 = bitcast double* %7 to i8*
%12 = bitcast double* %8 to i8*
%13 = load i32, i32* @M_PI
%14 = shl nsw i32 %13, 1
%15 = sitofp i32 %14 to double
%16 = fmul double %15, %0
%17 = tail call double @log(double %16)
%18 = fmul double %16, 2.000000e+00
%19 = tail call double @log(double %18)
%20 = fptosi double %18 to i32
%21 = tail call double @sin(i32 %20)
%22 = tail call double @cos(i32 %20)
%23 = call i32 @sine_cosine_integrals(i32 %20, double* %5, double* %7)
%24 = fmul double %16, 4.000000e+00
%25 = fptosi double %24 to i32
%26 = call i32 @sine_cosine_integrals(i32 %25, double* %6, double* %8)
%27 = call double @log(double %1)
%28 = fadd double %19, 0x3FE2788CFC6FB619
%29 = load double, double* %7
%30 = fsub double %28, %29
%31 = load double, double* %6
%32 = load double, double* %5
%33 = call double @llvm.fmuladd.f64(double %32, double -2.000000e+00, double %31)
%34 = fmul double %21, %33
%35 = call double @llvm.fmuladd.f64(double %30, double 2.000000e+00, double %34)
%36 = fadd double %17, 0x3FE2788CFC6FB619
%37 = load double, double* %8
%38 = fadd double %36, %37
%39 = call double @llvm.fmuladd.f64(double %29, double -2.000000e+00, double %38)
%40 = call double @llvm.fmuladd.f64(double %22, double %39, double %35)
%41 = fmul double %40, 3.000000e+01
store double %41, double* %2
%42 = call double @llvm.fmuladd.f64(double %27, double -2.000000e+00, double %39)
%43 = fmul double %21, %42
%44 = call double @llvm.fmuladd.f64(double %32, double 2.000000e+00, double %43)
%45 = fneg double %31
%46 = call double @llvm.fmuladd.f64(double %32, double 2.000000e+00, double %45)
%47 = call double @llvm.fmuladd.f64(double %22, double %46, double %44)
%48 = fmul double %47, 3.000000e+01
store double %48, double* %3
ret void
}