#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 *);
void geoRads2Dms(double rads, double *deg, double *min, double *sec,
                 double *dir) {
  double temp;
  double fraction;
  if (rads < 0.0)
    *dir = -1.0;
  else
    *dir = 1.0;
  rads = fabs(rads);
  temp = (180.0 / 3.14159265358979323846) * rads;
  fraction = modf(temp, deg);
  temp = fraction * 60.0;
  fraction = modf(temp, min);
  *sec = fraction * 60.0;
}


x86 assembly (clang, -O0):
<geoRads2Dms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1150 <geoRads2Dms+0x40>
mov    -0x28(%rbp),%rax
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1160 <geoRads2Dms+0x50>
mov    -0x28(%rbp),%rax
movsd  0xea4(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
movaps 0xeb4(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe9b(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <modf@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xe6e(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
call   1030 <modf@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xe49(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geoRads2Dms>:
push   %r14
push   %rbx
push   %rax
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
mov    %rdx,%r14
mov    %rsi,%rbx
lea    0xed2(%rip),%rdx
movsd  (%rdx,%rax,8),%xmm1
movsd  %xmm1,(%rcx)
andpd  0xed1(%rip),%xmm0
mulsd  0xed9(%rip),%xmm0
call   1030 <modf@plt>
mulsd  0xed4(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <modf@plt>
mulsd  0xec4(%rip),%xmm0
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @geoRads2Dms(double %0, double* nocapture %1, double* nocapture %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = fcmp olt double %0, 0.000000e+00
%7 = select i1 %6, double -1.000000e+00, double 1.000000e+00
store double %7, double* %4
%8 = tail call double @llvm.fabs.f64(double %0)
%9 = fmul double %8, 0x404CA5DC1A63C1F8
%10 = tail call double @modf(double %9, double* %1)
%11 = fmul double %10, 6.000000e+01
%12 = tail call double @modf(double %11, double* %2)
%13 = fmul double %12, 6.000000e+01
store double %13, double* %3
ret void
}