#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 sin(double);
void geom_gam_sph_rtp(double x[], double gam[3][3]) {
  double r = x[0];
  double st = sin(x[1]);
  gam[0][0] = 1.0;
  gam[0][1] = 0.0;
  gam[0][2] = 0.0;
  gam[1][0] = 0.0;
  gam[1][1] = r * r;
  gam[1][2] = 0.0;
  gam[2][0] = 0.0;
  gam[2][1] = 0.0;
  gam[2][2] = r * r * st * st;
}


x86 assembly (clang, -O0):
<geom_gam_sph_rtp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xeb4(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x18(%rax)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x28(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x30(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x38(%rax)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x40(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geom_gam_sph_rtp>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movsd  (%rdi),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rdi),%xmm0
call   1030 <sin@plt>
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rbx)
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm2
xorps  %xmm1,%xmm1
movups %xmm1,0x8(%rbx)
movq   $0x0,0x18(%rbx)
movsd  %xmm2,0x20(%rbx)
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movups %xmm1,0x28(%rbx)
movq   $0x0,0x38(%rbx)
movsd  %xmm2,0x40(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @geom_gam_sph_rtp(double* %0, [3 x double]* %1) {
%3 = alloca double*
%4 = alloca [3 x double]*
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store [3 x double]* %1, [3 x double]** %4
%7 = load double*, double** %3
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
store double %9, double* %5
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = call double @sin(double %12)
store double %13, double* %6
%14 = load [3 x double]*, [3 x double]** %4
%15 = getelementptr inbounds [3 x double], [3 x double]* %14, i64 0
%16 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 0
store double 1.000000e+00, double* %16
%17 = load [3 x double]*, [3 x double]** %4
%18 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0
%19 = getelementptr inbounds [3 x double], [3 x double]* %18, i64 0, i64 1
store double 0.000000e+00, double* %19
%20 = load [3 x double]*, [3 x double]** %4
%21 = getelementptr inbounds [3 x double], [3 x double]* %20, i64 0
%22 = getelementptr inbounds [3 x double], [3 x double]* %21, i64 0, i64 2
store double 0.000000e+00, double* %22
%23 = load [3 x double]*, [3 x double]** %4
%24 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 1
%25 = getelementptr inbounds [3 x double], [3 x double]* %24, i64 0, i64 0
store double 0.000000e+00, double* %25
%26 = load double, double* %5
%27 = load double, double* %5
%28 = fmul double %26, %27
%29 = load [3 x double]*, [3 x double]** %4
%30 = getelementptr inbounds [3 x double], [3 x double]* %29, i64 1
%31 = getelementptr inbounds [3 x double], [3 x double]* %30, i64 0, i64 1
store double %28, double* %31
%32 = load [3 x double]*, [3 x double]** %4
%33 = getelementptr inbounds [3 x double], [3 x double]* %32, i64 1
%34 = getelementptr inbounds [3 x double], [3 x double]* %33, i64 0, i64 2
store double 0.000000e+00, double* %34
%35 = load [3 x double]*, [3 x double]** %4
%36 = getelementptr inbounds [3 x double], [3 x double]* %35, i64 2
%37 = getelementptr inbounds [3 x double], [3 x double]* %36, i64 0, i64 0
store double 0.000000e+00, double* %37
%38 = load [3 x double]*, [3 x double]** %4
%39 = getelementptr inbounds [3 x double], [3 x double]* %38, i64 2
%40 = getelementptr inbounds [3 x double], [3 x double]* %39, i64 0, i64 1
store double 0.000000e+00, double* %40
%41 = load double, double* %5
%42 = load double, double* %5
%43 = fmul double %41, %42
%44 = load double, double* %6
%45 = fmul double %43, %44
%46 = load double, double* %6
%47 = fmul double %45, %46
%48 = load [3 x double]*, [3 x double]** %4
%49 = getelementptr inbounds [3 x double], [3 x double]* %48, i64 2
%50 = getelementptr inbounds [3 x double], [3 x double]* %49, i64 0, i64 2
store double %47, double* %50
ret void
}

LLVM IR (-O2):
define void @geom_gam_sph_rtp(double* nocapture %0, [3 x double]* nocapture writeonly %1) {
%3 = load double, double* %0
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = tail call double @sin(double %5)
%7 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
store double 1.000000e+00, double* %7
%8 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%9 = fmul double %3, %3
%10 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 1
%11 = bitcast double* %8 to i8*
store double %9, double* %10
%12 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 2
%13 = fmul double %9, %6
%14 = fmul double %6, %13
%15 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 2
%16 = bitcast double* %12 to i8*
store double %14, double* %15
ret void
}