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


x86 assembly (clang, -O0):
<geom_gam_sph_tpr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xec2(%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)
mov    -0x10(%rbp),%rax
movsd  0xe57(%rip),%xmm0
movsd  %xmm0,0x40(%rax)
add    $0x20,%rsp
pop    %rbp
ret

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

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

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