#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 */
int fabs(double);
scalar_t__ rint(int);
void getSexComponents(double value, int *d, int *m, int *s) {
  *d = (int)fabs(value);
  *m = (int)((fabs(value) - *d) * 60.0);
  *s = (int)rint(((fabs(value) - *d) * 60.0 - *m) * 60.0);
  if (value < 0)
    *d *= -1;
}


x86 assembly (clang, -O0):
<getSexComponents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe99(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
cvtsi2sd %eax,%xmm0
mov    -0x18(%rbp),%rax
cvtsi2sdl (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe50(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe40(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <rint@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11ec <getSexComponents+0xcc>
mov    -0x10(%rbp),%rax
imul   $0xffffffff,(%rax),%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSexComponents>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
call   1030 <fabs@plt>
mov    %eax,(%rbx)
movsd  0x8(%rsp),%xmm0
call   1030 <fabs@plt>
sub    (%rbx),%eax
imul   $0x3c,%eax,%eax
mov    %eax,(%r15)
movsd  0x8(%rsp),%xmm0
call   1030 <fabs@plt>
sub    (%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
cvtsi2sdl (%r15),%xmm1
movsd  0xe8d(%rip),%xmm2
mulsd  %xmm2,%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <rint@plt>
mov    %eax,(%r14)
xorpd  %xmm0,%xmm0
ucomisd 0x8(%rsp),%xmm0
jbe    1199 <getSexComponents+0x79>
negl   (%rbx)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @getSexComponents(double %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca double
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store double %0, double* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load double, double* %5
%10 = call i32 @fabs(double %9)
%11 = load i32*, i32** %6
store i32 %10, i32* %11
%12 = load double, double* %5
%13 = call i32 @fabs(double %12)
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = sub nsw i32 %13, %15
%17 = sitofp i32 %16 to double
%18 = fmul double %17, 6.000000e+01
%19 = fptosi double %18 to i32
%20 = load i32*, i32** %7
store i32 %19, i32* %20
%21 = load double, double* %5
%22 = call i32 @fabs(double %21)
%23 = load i32*, i32** %6
%24 = load i32, i32* %23
%25 = sub nsw i32 %22, %24
%26 = sitofp i32 %25 to double
%27 = load i32*, i32** %7
%28 = load i32, i32* %27
%29 = sitofp i32 %28 to double
%30 = fneg double %29
%31 = call double @llvm.fmuladd.f64(double %26, double 6.000000e+01, double %30)
%32 = fmul double %31, 6.000000e+01
%33 = fptosi double %32 to i32
%34 = call i64 @rint(i32 %33)
%35 = trunc i64 %34 to i32
%36 = load i32*, i32** %8
store i32 %35, i32* %36
%37 = load double, double* %5
%38 = fcmp olt double %37, 0.000000e+00
br i1 %38, label %39, label %43
39: ; preds = %4
%40 = load i32*, i32** %6
%41 = load i32, i32* %40
%42 = mul nsw i32 %41, -1
store i32 %42, i32* %40
br label %43
43: ; preds = %39, %4
ret void
}

LLVM IR (-O2):
define void @getSexComponents(double %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture writeonly %3) {
%5 = tail call i32 @fabs(double %0)
store i32 %5, i32* %1
%6 = tail call i32 @fabs(double %0)
%7 = load i32, i32* %1
%8 = sub nsw i32 %6, %7
%9 = mul i32 %8, 60
store i32 %9, i32* %2
%10 = tail call i32 @fabs(double %0)
%11 = load i32, i32* %1
%12 = sub nsw i32 %10, %11
%13 = sitofp i32 %12 to double
%14 = load i32, i32* %2
%15 = sitofp i32 %14 to double
%16 = fneg double %15
%17 = tail call double @llvm.fmuladd.f64(double %13, double 6.000000e+01, double %16)
%18 = fmul double %17, 6.000000e+01
%19 = fptosi double %18 to i32
%20 = tail call i64 @rint(i32 %19)
%21 = trunc i64 %20 to i32
store i32 %21, i32* %3
%22 = fcmp olt double %0, 0.000000e+00
br i1 %22, label %23, label %26
23: ; preds = %4
%24 = load i32, i32* %1
%25 = sub nsw i32 0, %24
store i32 %25, i32* %1
br label %26
26: ; preds = %23, %4
ret void
}