#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_pt_from_ct(double, double);
double gsw_pt_from_t(double, double, double, double);
double gsw_adiabatic_lapse_rate_from_ct(double sa, double ct, double p) {
  int n0, n1, n2;
  double pt0, pr0, t;
  n0 = 0;
  n1 = 1;
  n2 = 2;
  pr0 = 0e0;
  pt0 = gsw_pt_from_ct(sa, ct);
  t = gsw_pt_from_t(sa, pt0, pr0, p);
  return (-gsw_gibbs(n0, n1, n1, sa, t, p) / (gsw_gibbs(n0, n2, n0, sa, t, p)));
}


x86 assembly (clang, -O0):
<gsw_adiabatic_lapse_rate_from_ct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <gsw_pt_from_ct@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
call   1040 <gsw_pt_from_t@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x20(%rbp),%edx
movsd  -0x8(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1050 <gsw_gibbs@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x1c(%rbp),%edx
movsd  -0x8(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1050 <gsw_gibbs@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_adiabatic_lapse_rate_from_ct>:
sub    $0x38,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <gsw_pt_from_ct@plt>
movaps %xmm0,%xmm1
xorps  %xmm2,%xmm2
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm3
call   1040 <gsw_pt_from_t@plt>
movaps %xmm0,%xmm1
movsd  %xmm0,0x18(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm2
call   1050 <gsw_gibbs@plt>
xorps  0xe77(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
xor    %edi,%edi
mov    $0x2,%esi
xor    %edx,%edx
movsd  0x8(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
call   1050 <gsw_gibbs@plt>
movapd 0x20(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @gsw_adiabatic_lapse_rate_from_ct(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
%12 = 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
store double 0.000000e+00, double* %11
%13 = load double, double* %4
%14 = load double, double* %5
%15 = call double @gsw_pt_from_ct(double %13, double %14)
store double %15, double* %10
%16 = load double, double* %4
%17 = load double, double* %10
%18 = load double, double* %11
%19 = load double, double* %6
%20 = call double @gsw_pt_from_t(double %16, double %17, double %18, double %19)
store double %20, double* %12
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = load i32, i32* %8
%24 = load double, double* %4
%25 = load double, double* %12
%26 = load double, double* %6
%27 = call double @gsw_gibbs(i32 %21, i32 %22, i32 %23, double %24, double %25, double %26)
%28 = fneg double %27
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = load i32, i32* %7
%32 = load double, double* %4
%33 = load double, double* %12
%34 = load double, double* %6
%35 = call double @gsw_gibbs(i32 %29, i32 %30, i32 %31, double %32, double %33, double %34)
%36 = fdiv double %28, %35
ret double %36
}

LLVM IR (-O2):
define double @gsw_adiabatic_lapse_rate_from_ct(double %0, double %1, double %2) {
%4 = tail call double @gsw_pt_from_ct(double %0, double %1)
%5 = tail call double @gsw_pt_from_t(double %0, double %4, double 0.000000e+00, double %2)
%6 = tail call double @gsw_gibbs(i32 0, i32 1, i32 1, double %0, double %5, double %2)
%7 = fneg double %6
%8 = tail call double @gsw_gibbs(i32 0, i32 2, i32 0, double %0, double %5, double %2)
%9 = fdiv double %7, %8
ret double %9
}