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


x86 assembly (clang, -O0):
<geom_igam_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),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xe88(%rip),%xmm0
divsd  %xmm1,%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  0xe4b(%rip),%xmm0
movsd  %xmm0,0x40(%rax)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @geom_igam_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 = fdiv double 1.000000e+00, %24
%26 = load [3 x double]*, [3 x double]** %4
%27 = getelementptr inbounds [3 x double], [3 x double]* %26, i64 1
%28 = getelementptr inbounds [3 x double], [3 x double]* %27, i64 0, i64 1
store double %25, double* %28
%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 2
store double 0.000000e+00, double* %31
%32 = load [3 x double]*, [3 x double]** %4
%33 = getelementptr inbounds [3 x double], [3 x double]* %32, i64 2
%34 = getelementptr inbounds [3 x double], [3 x double]* %33, i64 0, i64 0
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 1
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 2
store double 1.000000e+00, double* %40
ret void
}

LLVM IR (-O2):
define void @geom_igam_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 = fdiv double 1.000000e+00, %7
%9 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 1
%10 = bitcast double* %6 to i8*
store double %8, double* %9
%11 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 1, i64 2
%12 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 2, i64 2
%13 = bitcast double* %11 to i8*
store double 1.000000e+00, double* %12
ret void
}