#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 fabs(double);
double modf(double, double *);
double geoDecdms2Rads(double in) {
  double t1, m, d, s, sign;
  if (in < 0.0)
    sign = -1.0;
  else
    sign = 1.0;
  s = modf(fabs(in) / 100.0, &t1) * 100.0;
  m = modf(t1 / 100.0, &d) * 100.0;
  return ((d + (m / 60.0) + (s / 3600.0)) * sign *
          (3.14159265358979323846 / 180.0));
}


x86 assembly (clang, -O0):
<geoDecdms2Rads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <geoDecdms2Rads+0x2d>
movsd  0xed5(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    114a <geoDecdms2Rads+0x3a>
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeda(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    -0x10(%rbp),%rdi
call   1030 <modf@plt>
movsd  0xeb1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe9b(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    -0x20(%rbp),%rdi
call   1030 <modf@plt>
movsd  0xe86(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe63(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xe46(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  0xe29(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geoDecdms2Rads>:
sub    $0x38,%rsp
movapd %xmm0,%xmm1
movapd %xmm0,0x20(%rsp)
movapd 0xeda(%rip),%xmm0
andpd  %xmm1,%xmm0
divsd  0xf0e(%rip),%xmm0
lea    0x8(%rsp),%rdi
call   1030 <modf@plt>
movapd %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
divsd  0xef0(%rip),%xmm0
mov    %rsp,%rdi
call   1030 <modf@plt>
movapd 0x10(%rsp),%xmm1
unpcklpd %xmm0,%xmm1
mulpd  0xea6(%rip),%xmm1
divpd  0xeae(%rip),%xmm1
movapd %xmm1,%xmm3
unpckhpd %xmm1,%xmm3
addsd  (%rsp),%xmm3
addsd  %xmm1,%xmm3
movapd 0xea5(%rip),%xmm1
xorpd  %xmm3,%xmm1
xorpd  %xmm2,%xmm2
movapd 0x20(%rsp),%xmm0
cmpltsd %xmm2,%xmm0
movapd %xmm0,%xmm2
andnpd %xmm3,%xmm2
andpd  %xmm1,%xmm0
orpd   %xmm2,%xmm0
mulsd  0xe92(%rip),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @geoDecdms2Rads(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %2
%8 = load double, double* %2
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %1
store double -1.000000e+00, double* %7
br label %12
11: ; preds = %1
store double 1.000000e+00, double* %7
br label %12
12: ; preds = %11, %10
%13 = load double, double* %2
%14 = call double @llvm.fabs.f64(double %13)
%15 = fdiv double %14, 1.000000e+02
%16 = call double @modf(double %15, double* %3)
%17 = fmul double %16, 1.000000e+02
store double %17, double* %6
%18 = load double, double* %3
%19 = fdiv double %18, 1.000000e+02
%20 = call double @modf(double %19, double* %5)
%21 = fmul double %20, 1.000000e+02
store double %21, double* %4
%22 = load double, double* %5
%23 = load double, double* %4
%24 = fdiv double %23, 6.000000e+01
%25 = fadd double %22, %24
%26 = load double, double* %6
%27 = fdiv double %26, 3.600000e+03
%28 = fadd double %25, %27
%29 = load double, double* %7
%30 = fmul double %28, %29
%31 = fmul double %30, 0x3F91DF46A2529D39
ret double %31
}

LLVM IR (-O2):
define double @geoDecdms2Rads(double %0) {
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %2 to i8*
%5 = bitcast double* %3 to i8*
%6 = fcmp olt double %0, 0.000000e+00
%7 = tail call double @llvm.fabs.f64(double %0)
%8 = fdiv double %7, 1.000000e+02
%9 = call double @modf(double %8, double* %2)
%10 = load double, double* %2
%11 = fdiv double %10, 1.000000e+02
%12 = call double @modf(double %11, double* %3)
%13 = insertelement <2 x double> poison, double %9, i64 0
%14 = insertelement <2 x double> %13, double %12, i64 1
%15 = fmul <2 x double> %14, <double 1.000000e+02, double 1.000000e+02>
%16 = load double, double* %3
%17 = fdiv <2 x double> %15, <double 3.600000e+03, double 6.000000e+01>
%18 = extractelement <2 x double> %17, i64 1
%19 = fadd double %16, %18
%20 = extractelement <2 x double> %17, i64 0
%21 = fadd double %20, %19
%22 = fneg double %21
%23 = select i1 %6, double %22, double %21
%24 = fmul double %23, 0x3F91DF46A2529D39
ret double %24
}