#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 geoDD2Dms(double dd, double *deg, double *min, double *sec, double *dir) {
  double temp;
  double fraction;
  if (dd < 0.0)
    *dir = -1.0;
  else
    *dir = 1.0;
  dd = fabs(dd);
  fraction = modf(dd, deg);
  temp = fraction * 60.0;
  fraction = modf(temp, min);
  *sec = fraction * 60.0;
}


x86 assembly (clang, -O0):
<geoDD2Dms>:
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 <geoDD2Dms+0x40>
mov    -0x28(%rbp),%rax
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1160 <geoDD2Dms+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  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <modf@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  0xe80(%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  0xe5b(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geoDD2Dms>:
push   %r14
push   %rbx
push   %rax
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
mov    %rdx,%r14
mov    %rsi,%rbx
seta   %al
lea    0xed2(%rip),%rdx
movsd  (%rdx,%rax,8),%xmm1
movsd  %xmm1,(%rcx)
andpd  0xed1(%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 @geoDD2Dms(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 = load double*, double** %7
%24 = call double @modf(double %22, double* %23)
store double %24, double* %12
%25 = load double, double* %12
%26 = fmul double %25, 6.000000e+01
store double %26, double* %11
%27 = load double, double* %11
%28 = load double*, double** %8
%29 = call double @modf(double %27, double* %28)
store double %29, double* %12
%30 = load double, double* %12
%31 = fmul double %30, 6.000000e+01
%32 = load double*, double** %9
store double %31, double* %32
ret void
}

LLVM IR (-O2):
define void @geoDD2Dms(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 = tail call double @modf(double %8, double* %1)
%10 = fmul double %9, 6.000000e+01
%11 = tail call double @modf(double %10, double* %2)
%12 = fmul double %11, 6.000000e+01
store double %12, double* %3
ret void
}