#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 gsw_gibbs(int, int, int, double, double, double);
double gsw_kappa_t_exact(double sa, double t, double p) {
  int n0, n1, n2;
  double g_tt, g_tp;
  n0 = 0;
  n1 = 1;
  n2 = 2;
  g_tt = gsw_gibbs(n0, n2, n0, sa, t, p);
  g_tp = gsw_gibbs(n0, n1, n1, sa, t, p);
  return ((g_tp * g_tp - g_tt * gsw_gibbs(n0, n0, n2, sa, t, p)) /
          (gsw_gibbs(n0, n0, n1, sa, t, p) * g_tt));
}


x86 assembly (clang, -O0):
<gsw_kappa_t_exact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x2,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x1c(%rbp),%edx
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <gsw_gibbs@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x20(%rbp),%edx
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <gsw_gibbs@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x24(%rbp),%edx
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <gsw_gibbs@plt>
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <gsw_gibbs@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_kappa_t_exact>:
sub    $0x28,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %edi,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <gsw_gibbs@plt>
movsd  %xmm0,0x20(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1030 <gsw_gibbs@plt>
movsd  %xmm0,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
mov    $0x2,%edx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1030 <gsw_gibbs@plt>
mulsd  0x20(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1030 <gsw_gibbs@plt>
mulsd  0x20(%rsp),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @gsw_kappa_t_exact(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
%11 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store i32 0, i32* %7
store i32 1, i32* %8
store i32 2, i32* %9
%12 = load i32, i32* %7
%13 = load i32, i32* %9
%14 = load i32, i32* %7
%15 = load double, double* %4
%16 = load double, double* %5
%17 = load double, double* %6
%18 = call double @gsw_gibbs(i32 %12, i32 %13, i32 %14, double %15, double %16, double %17)
store double %18, double* %10
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = load i32, i32* %8
%22 = load double, double* %4
%23 = load double, double* %5
%24 = load double, double* %6
%25 = call double @gsw_gibbs(i32 %19, i32 %20, i32 %21, double %22, double %23, double %24)
store double %25, double* %11
%26 = load double, double* %11
%27 = load double, double* %11
%28 = load double, double* %10
%29 = load i32, i32* %7
%30 = load i32, i32* %7
%31 = load i32, i32* %9
%32 = load double, double* %4
%33 = load double, double* %5
%34 = load double, double* %6
%35 = call double @gsw_gibbs(i32 %29, i32 %30, i32 %31, double %32, double %33, double %34)
%36 = fmul double %28, %35
%37 = fneg double %36
%38 = call double @llvm.fmuladd.f64(double %26, double %27, double %37)
%39 = load i32, i32* %7
%40 = load i32, i32* %7
%41 = load i32, i32* %8
%42 = load double, double* %4
%43 = load double, double* %5
%44 = load double, double* %6
%45 = call double @gsw_gibbs(i32 %39, i32 %40, i32 %41, double %42, double %43, double %44)
%46 = load double, double* %10
%47 = fmul double %45, %46
%48 = fdiv double %38, %47
ret double %48
}

LLVM IR (-O2):
define double @gsw_kappa_t_exact(double %0, double %1, double %2) {
%4 = tail call double @gsw_gibbs(i32 0, i32 2, i32 0, double %0, double %1, double %2)
%5 = tail call double @gsw_gibbs(i32 0, i32 1, i32 1, double %0, double %1, double %2)
%6 = tail call double @gsw_gibbs(i32 0, i32 0, i32 2, double %0, double %1, double %2)
%7 = fneg double %4
%8 = fmul double %6, %7
%9 = tail call double @llvm.fmuladd.f64(double %5, double %5, double %8)
%10 = tail call double @gsw_gibbs(i32 0, i32 0, i32 1, double %0, double %1, double %2)
%11 = fmul double %4, %10
%12 = fdiv double %9, %11
ret double %12
}