#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 exp(double);
double log(double);
double sqrt(int);
void prop2(int l, double r, double visc, double p[3][3]) {
  int LL, rLL;
  double alpha, rnu, x1, x2, x3, ss, cc;
  LL = l * (l + 1);
  rLL = LL;
  alpha = sqrt(1 + 4 * rLL);
  rnu = log(r);
  x2 = exp(-0.5 * rnu);
  x1 = x2 / alpha;
  x2 = exp(0.5 * rnu * alpha);
  x3 = exp(-0.5 * rnu * alpha);
  ss = (x2 - x3) / 2.0;
  cc = (x2 + x3) / 2.0;
  p[1][1] = x1 * (3.0 * ss + alpha * cc);
  p[1][2] = x1 * 2.0 * ss / visc;
  p[2][1] = x1 * 2.0 * (rLL - 2.0) * visc * ss;
  p[2][2] = x1 * (-3.0 * ss + alpha * cc);
}


x86 assembly (clang, -O0):
<prop2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
shl    $0x2,%edi
add    $0x1,%edi
call   1050 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xe90(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe72(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  0xe4e(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  0xe18(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  0xdfd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  -0x60(%rbp),%xmm2
movsd  0xde0(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x20(%rax)
movsd  0xdbb(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x28(%rax)
movsd  0xd9b(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
movsd  0xd89(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x38(%rax)
movsd  -0x40(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  -0x60(%rbp),%xmm2
movsd  0xd4a(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x40(%rax)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prop2>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
movsd  %xmm1,0x30(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0x1(%rdi),%ebx
imul   %edi,%ebx
lea    0x1(,%rbx,4),%edi
call   1050 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <log@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
movsd  0xe86(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x28(%rsp)
call   1030 <exp@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm2
mulsd  0xe62(%rip),%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,(%rsp)
movsd  0x28(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1030 <exp@plt>
movsd  (%rsp),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
movsd  0xe2a(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm0,%xmm2
mulsd  %xmm3,%xmm2
mulsd  0x8(%rsp),%xmm2
movsd  0xe18(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
movapd %xmm2,%xmm5
movapd 0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x20(%r14)
movapd %xmm2,%xmm0
movapd %xmm2,%xmm4
addsd  %xmm2,%xmm0
xorps  %xmm2,%xmm2
cvtsi2sd %ebx,%xmm2
addsd  0xde9(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm0
movsd  0x30(%rsp),%xmm3
divsd  %xmm3,%xmm0
movsd  %xmm0,0x28(%r14)
mulsd  %xmm3,%xmm2
movsd  0xdcd(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm5,%xmm0
unpcklpd %xmm4,%xmm2
unpcklpd %xmm0,%xmm1
mulpd  %xmm2,%xmm1
movupd %xmm1,0x38(%r14)
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @prop2(i32 %0, double %1, double %2, [3 x double]* %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca [3 x double]*
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double %2, double* %7
store [3 x double]* %3, [3 x double]** %8
%18 = load i32, i32* %5
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
%21 = mul nsw i32 %18, %20
store i32 %21, i32* %9
%22 = load i32, i32* %9
store i32 %22, i32* %10
%23 = load i32, i32* %10
%24 = mul nsw i32 4, %23
%25 = add nsw i32 1, %24
%26 = call double @sqrt(i32 %25)
store double %26, double* %11
%27 = load double, double* %6
%28 = call double @log(double %27)
store double %28, double* %12
%29 = load double, double* %12
%30 = fmul double -5.000000e-01, %29
%31 = call double @exp(double %30)
store double %31, double* %14
%32 = load double, double* %14
%33 = load double, double* %11
%34 = fdiv double %32, %33
store double %34, double* %13
%35 = load double, double* %12
%36 = fmul double 5.000000e-01, %35
%37 = load double, double* %11
%38 = fmul double %36, %37
%39 = call double @exp(double %38)
store double %39, double* %14
%40 = load double, double* %12
%41 = fmul double -5.000000e-01, %40
%42 = load double, double* %11
%43 = fmul double %41, %42
%44 = call double @exp(double %43)
store double %44, double* %15
%45 = load double, double* %14
%46 = load double, double* %15
%47 = fsub double %45, %46
%48 = fdiv double %47, 2.000000e+00
store double %48, double* %16
%49 = load double, double* %14
%50 = load double, double* %15
%51 = fadd double %49, %50
%52 = fdiv double %51, 2.000000e+00
store double %52, double* %17
%53 = load double, double* %13
%54 = load double, double* %16
%55 = load double, double* %11
%56 = load double, double* %17
%57 = fmul double %55, %56
%58 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %54, double %57)
%59 = fmul double %53, %58
%60 = load [3 x double]*, [3 x double]** %8
%61 = getelementptr inbounds [3 x double], [3 x double]* %60, i64 1
%62 = getelementptr inbounds [3 x double], [3 x double]* %61, i64 0, i64 1
store double %59, double* %62
%63 = load double, double* %13
%64 = fmul double %63, 2.000000e+00
%65 = load double, double* %16
%66 = fmul double %64, %65
%67 = load double, double* %7
%68 = fdiv double %66, %67
%69 = load [3 x double]*, [3 x double]** %8
%70 = getelementptr inbounds [3 x double], [3 x double]* %69, i64 1
%71 = getelementptr inbounds [3 x double], [3 x double]* %70, i64 0, i64 2
store double %68, double* %71
%72 = load double, double* %13
%73 = fmul double %72, 2.000000e+00
%74 = load i32, i32* %10
%75 = sitofp i32 %74 to double
%76 = fsub double %75, 2.000000e+00
%77 = fmul double %73, %76
%78 = load double, double* %7
%79 = fmul double %77, %78
%80 = load double, double* %16
%81 = fmul double %79, %80
%82 = load [3 x double]*, [3 x double]** %8
%83 = getelementptr inbounds [3 x double], [3 x double]* %82, i64 2
%84 = getelementptr inbounds [3 x double], [3 x double]* %83, i64 0, i64 1
store double %81, double* %84
%85 = load double, double* %13
%86 = load double, double* %16
%87 = load double, double* %11
%88 = load double, double* %17
%89 = fmul double %87, %88
%90 = call double @llvm.fmuladd.f64(double -3.000000e+00, double %86, double %89)
%91 = fmul double %85, %90
%92 = load [3 x double]*, [3 x double]** %8
%93 = getelementptr inbounds [3 x double], [3 x double]* %92, i64 2
%94 = getelementptr inbounds [3 x double], [3 x double]* %93, i64 0, i64 2
store double %91, double* %94
ret void
}

LLVM IR (-O2):
define void @prop2(i32 %0, double %1, double %2, [3 x double]* nocapture writeonly %3) {
%5 = add nsw i32 %0, 1
%6 = mul nsw i32 %5, %0
%7 = shl nsw i32 %6, 2
%8 = or i32 %7, 1
%9 = tail call double @sqrt(i32 %8)
%10 = tail call double @log(double %1)
%11 = fmul double %10, -5.000000e-01
%12 = tail call double @exp(double %11)
%13 = fdiv double %12, %9
%14 = fmul double %10, 5.000000e-01
%15 = fmul double %9, %14
%16 = tail call double @exp(double %15)
%17 = fmul double %9, %11
%18 = tail call double @exp(double %17)
%19 = fsub double %16, %18
%20 = fmul double %19, 5.000000e-01
%21 = fadd double %16, %18
%22 = fmul double %21, 5.000000e-01
%23 = fmul double %9, %22
%24 = tail call double @llvm.fmuladd.f64(double %20, double 3.000000e+00, double %23)
%25 = fmul double %13, %24
%26 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 1, i64 1
store double %25, double* %26
%27 = fmul double %13, 2.000000e+00
%28 = fmul double %27, %20
%29 = fdiv double %28, %2
%30 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 1, i64 2
store double %29, double* %30
%31 = sitofp i32 %6 to double
%32 = fadd double %31, -2.000000e+00
%33 = fmul double %32, %27
%34 = fmul double %33, %2
%35 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 2, i64 1
%36 = tail call double @llvm.fmuladd.f64(double %20, double -3.000000e+00, double %23)
%37 = insertelement <2 x double> poison, double %34, i64 0
%38 = insertelement <2 x double> %37, double %13, i64 1
%39 = insertelement <2 x double> poison, double %20, i64 0
%40 = insertelement <2 x double> %39, double %36, i64 1
%41 = fmul <2 x double> %38, %40
%42 = bitcast double* %35 to <2 x double>*
store <2 x double> %41, <2 x double>* %42
ret void
}