#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_ct_from_pt(double, double);
double gsw_gibbs_pt0_pt0(double, double);
double gsw_pt_from_ct(double sa, double ct) {
  int n0, n2;
  double s1, p0, cp0;
  double a0, a1, a2, a3, a4, a5, b0, b1, b2, b3;
  double a5ct, b3ct, ct_factor, pt_num, pt_den, ct_diff;
  double pt, pt_old, ptm, dct_dpt;
  cp0 = 3991.86795711963e0;
  n0 = 0;
  n2 = 2;
  s1 = sa * 35.e0 / 35.16504e0;
  p0 = 0.e0;
  a0 = -1.446013646344788e-2;
  a1 = -3.305308995852924e-3;
  a2 = 1.062415929128982e-4;
  a3 = 9.477566673794488e-1;
  a4 = 2.166591947736613e-3;
  a5 = 3.828842955039902e-3;
  b0 = 1.000000000000000e0;
  b1 = 6.506097115635800e-4;
  b2 = 3.830289486850898e-3;
  b3 = 1.247811760368034e-6;
  a5ct = a5 * ct;
  b3ct = b3 * ct;
  ;
  ct_factor = (a3 + a4 * s1 + a5ct);
  pt_num = a0 + s1 * (a1 + a2 * s1) + ct * ct_factor;
  pt_den = b0 + b1 * s1 + ct * (b2 + b3ct);
  pt = (pt_num) / (pt_den);
  dct_dpt = (pt_den) / (ct_factor + a5ct - (b2 + b3ct + b3ct) * pt);
  ct_diff = gsw_ct_from_pt(sa, pt) - ct;
  pt_old = pt;
  pt = pt_old - (ct_diff) / dct_dpt;
  ptm = 0.5e0 * (pt + pt_old);
  dct_dpt = -(ptm + 273.15e0) * gsw_gibbs_pt0_pt0(sa, ptm) / cp0;
  pt = pt_old - (ct_diff) / dct_dpt;
  ct_diff = gsw_ct_from_pt(sa, pt) - ct;
  pt_old = pt;
  return (pt_old - (ct_diff) / dct_dpt);
}


x86 assembly (clang, -O0):
<gsw_pt_from_ct>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xf33(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
movsd  0xf10(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xefb(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xeb0(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe9b(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe86(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe71(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe5c(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe47(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe32(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe1d(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x50(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm3
movsd  -0x48(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
addsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
divsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm2
ff
addsd  -0x88(%rbp),%xmm2
ff
movsd  -0x78(%rbp),%xmm1
addsd  -0x90(%rbp),%xmm1
ff
addsd  -0x90(%rbp),%xmm1
ff
movsd  -0xb8(%rbp),%xmm3
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  -0xb8(%rbp),%xmm1
ff
call   1030 <gsw_ct_from_pt@plt>
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm1
ff
divsd  -0xd0(%rbp),%xmm1
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm1
ff
addsd  -0xc0(%rbp),%xmm1
ff
movsd  0xc63(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  0xc47(%rip),%xmm0
addsd  -0xc8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  -0xc8(%rbp),%xmm1
ff
call   1040 <gsw_gibbs_pt0_pt0@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm1
ff
divsd  -0xd0(%rbp),%xmm1
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
movsd  -0xb8(%rbp),%xmm1
ff
call   1030 <gsw_ct_from_pt@plt>
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
movsd  -0xb0(%rbp),%xmm1
ff
divsd  -0xd0(%rbp),%xmm1
ff
subsd  %xmm1,%xmm0
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsw_pt_from_ct>:
sub    $0x58,%rsp
movapd %xmm1,0x40(%rsp)
movsd  0xece(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm0,0x18(%rsp)
divsd  0xec4(%rip),%xmm2
movapd %xmm1,%xmm4
unpcklpd %xmm1,%xmm4
movapd 0xefc(%rip),%xmm1
mulpd  %xmm4,%xmm1
movsd  0xeb0(%rip),%xmm5
mulsd  %xmm2,%xmm5
addsd  0xeac(%rip),%xmm5
movsd  0xeac(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  0xea8(%rip),%xmm3
shufpd $0x2,0xed7(%rip),%xmm3
unpcklpd %xmm2,%xmm2
mulpd  %xmm2,%xmm3
addpd  0xed7(%rip),%xmm3
shufpd $0x2,0xede(%rip),%xmm5
addpd  %xmm1,%xmm5
mulpd  %xmm5,%xmm4
addpd  %xmm3,%xmm4
movapd %xmm4,%xmm2
unpckhpd %xmm4,%xmm2
divsd  %xmm2,%xmm4
addpd  %xmm1,%xmm5
movapd %xmm5,%xmm1
unpckhpd %xmm5,%xmm1
mulsd  %xmm4,%xmm1
movapd %xmm4,0x20(%rsp)
subsd  %xmm1,%xmm5
divsd  %xmm5,%xmm2
movapd %xmm2,(%rsp)
movapd %xmm4,%xmm1
call   1030 <gsw_ct_from_pt@plt>
subsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
movapd %xmm0,%xmm3
divsd  (%rsp),%xmm3
movapd 0x20(%rsp),%xmm0
movapd %xmm0,%xmm1
subsd  %xmm3,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xe1b(%rip),%xmm1
movsd  0xe1b(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1040 <gsw_gibbs_pt0_pt0@plt>
mulsd  (%rsp),%xmm0
divsd  0xe02(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x38(%rsp),%xmm2
divsd  %xmm0,%xmm2
movapd 0x20(%rsp),%xmm1
subsd  %xmm2,%xmm1
movapd %xmm1,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <gsw_ct_from_pt@plt>
subsd  0x40(%rsp),%xmm0
divsd  (%rsp),%xmm0
movapd 0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
define double @gsw_pt_from_ct(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0x40AF2FBC64E02648, double* %9
store i32 0, i32* %5
store i32 2, i32* %6
%30 = load double, double* %3
%31 = fmul double %30, 3.500000e+01
%32 = fdiv double %31, 0x4041952007DD4413
store double %32, double* %7
store double 0.000000e+00, double* %8
store double 0xBF8D9D46A9A64F32, double* %10
store double 0xBF6B13BC414AA727, double* %11
store double 0x3F1BD9C0AB0B71AE, double* %12
store double 0x3FEE5405CA5EBDE9, double* %13
store double 0x3F61BFAC31E5D50E, double* %14
store double 0x3F6F5DAA68BFD3B4, double* %15
store double 1.000000e+00, double* %16
store double 0x3F4551B5B7810AEB, double* %17
store double 0x3F6F60B302914DAA, double* %18
store double 0x3EB4EF4F8A305A1D, double* %19
%33 = load double, double* %15
%34 = load double, double* %4
%35 = fmul double %33, %34
store double %35, double* %20
%36 = load double, double* %19
%37 = load double, double* %4
%38 = fmul double %36, %37
store double %38, double* %21
%39 = load double, double* %13
%40 = load double, double* %14
%41 = load double, double* %7
%42 = call double @llvm.fmuladd.f64(double %40, double %41, double %39)
%43 = load double, double* %20
%44 = fadd double %42, %43
store double %44, double* %22
%45 = load double, double* %10
%46 = load double, double* %7
%47 = load double, double* %11
%48 = load double, double* %12
%49 = load double, double* %7
%50 = call double @llvm.fmuladd.f64(double %48, double %49, double %47)
%51 = call double @llvm.fmuladd.f64(double %46, double %50, double %45)
%52 = load double, double* %4
%53 = load double, double* %22
%54 = call double @llvm.fmuladd.f64(double %52, double %53, double %51)
store double %54, double* %23
%55 = load double, double* %16
%56 = load double, double* %17
%57 = load double, double* %7
%58 = call double @llvm.fmuladd.f64(double %56, double %57, double %55)
%59 = load double, double* %4
%60 = load double, double* %18
%61 = load double, double* %21
%62 = fadd double %60, %61
%63 = call double @llvm.fmuladd.f64(double %59, double %62, double %58)
store double %63, double* %24
%64 = load double, double* %23
%65 = load double, double* %24
%66 = fdiv double %64, %65
store double %66, double* %26
%67 = load double, double* %24
%68 = load double, double* %22
%69 = load double, double* %20
%70 = fadd double %68, %69
%71 = load double, double* %18
%72 = load double, double* %21
%73 = fadd double %71, %72
%74 = load double, double* %21
%75 = fadd double %73, %74
%76 = load double, double* %26
%77 = fneg double %75
%78 = call double @llvm.fmuladd.f64(double %77, double %76, double %70)
%79 = fdiv double %67, %78
store double %79, double* %29
%80 = load double, double* %3
%81 = load double, double* %26
%82 = call double @gsw_ct_from_pt(double %80, double %81)
%83 = load double, double* %4
%84 = fsub double %82, %83
store double %84, double* %25
%85 = load double, double* %26
store double %85, double* %27
%86 = load double, double* %27
%87 = load double, double* %25
%88 = load double, double* %29
%89 = fdiv double %87, %88
%90 = fsub double %86, %89
store double %90, double* %26
%91 = load double, double* %26
%92 = load double, double* %27
%93 = fadd double %91, %92
%94 = fmul double 5.000000e-01, %93
store double %94, double* %28
%95 = load double, double* %28
%96 = fadd double %95, 2.731500e+02
%97 = fneg double %96
%98 = load double, double* %3
%99 = load double, double* %28
%100 = call double @gsw_gibbs_pt0_pt0(double %98, double %99)
%101 = fmul double %97, %100
%102 = load double, double* %9
%103 = fdiv double %101, %102
store double %103, double* %29
%104 = load double, double* %27
%105 = load double, double* %25
%106 = load double, double* %29
%107 = fdiv double %105, %106
%108 = fsub double %104, %107
store double %108, double* %26
%109 = load double, double* %3
%110 = load double, double* %26
%111 = call double @gsw_ct_from_pt(double %109, double %110)
%112 = load double, double* %4
%113 = fsub double %111, %112
store double %113, double* %25
%114 = load double, double* %26
store double %114, double* %27
%115 = load double, double* %27
%116 = load double, double* %25
%117 = load double, double* %29
%118 = fdiv double %116, %117
%119 = fsub double %115, %118
ret double %119
}

LLVM IR (-O2):
define double @gsw_pt_from_ct(double %0, double %1) {
%3 = fmul double %0, 3.500000e+01
%4 = fdiv double %3, 0x4041952007DD4413
%5 = insertelement <2 x double> poison, double %1, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fmul <2 x double> %6, <double 0x3F6F5DAA68BFD3B4, double 0x3EB4EF4F8A305A1D>
%8 = tail call double @llvm.fmuladd.f64(double %4, double 0x3F61BFAC31E5D50E, double 0x3FEE5405CA5EBDE9)
%9 = tail call double @llvm.fmuladd.f64(double %4, double 0x3F1BD9C0AB0B71AE, double 0xBF6B13BC414AA727)
%10 = insertelement <2 x double> poison, double %4, i64 0
%11 = shufflevector <2 x double> %10, <2 x double> poison, <2 x i32> zeroinitializer
%12 = insertelement <2 x double> <double poison, double 0x3F4551B5B7810AEB>, double %9, i64 0
%13 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %11, <2 x double> %12, <2 x double> <double 0xBF8D9D46A9A64F32, double 1.000000e+00>)
%14 = insertelement <2 x double> <double poison, double 0x3F6F60B302914DAA>, double %8, i64 0
%15 = fadd <2 x double> %7, %14
%16 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %6, <2 x double> %15, <2 x double> %13)
%17 = extractelement <2 x double> %16, i64 0
%18 = extractelement <2 x double> %16, i64 1
%19 = fdiv double %17, %18
%20 = fadd <2 x double> %7, %15
%21 = extractelement <2 x double> %20, i64 0
%22 = fadd <2 x double> %7, %15
%23 = extractelement <2 x double> %22, i64 1
%24 = fneg double %23
%25 = tail call double @llvm.fmuladd.f64(double %24, double %19, double %21)
%26 = fdiv double %18, %25
%27 = tail call double @gsw_ct_from_pt(double %0, double %19)
%28 = fsub double %27, %1
%29 = fdiv double %28, %26
%30 = fsub double %19, %29
%31 = fadd double %19, %30
%32 = fmul double %31, 5.000000e-01
%33 = fadd double %32, 2.731500e+02
%34 = fneg double %33
%35 = tail call double @gsw_gibbs_pt0_pt0(double %0, double %32)
%36 = fmul double %35, %34
%37 = fdiv double %36, 0x40AF2FBC64E02648
%38 = fdiv double %28, %37
%39 = fsub double %19, %38
%40 = tail call double @gsw_ct_from_pt(double %0, double %39)
%41 = fsub double %40, %1
%42 = fdiv double %41, %37
%43 = fsub double %39, %42
ret double %43
}