#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 /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int main(void) {
  double d, m, s, dd;
  unsigned char sign;
  d = 1;
  while (d != -999.0) {
    sign = 0;
    scanf("%lf %lf %lf", &d, &m, &s);
    if (d == -999.0)
      continue;
    if (d < 0) {
      sign = 1;
      d *= -1.0;
    }
    dd = d + (m + (s / 60.0)) / 60.0;
    if (sign) {
      dd *= -1.0;
    }
    printf("\t%.8lf\n", dd);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    115e <main+0x3e>
jp     115e <main+0x3e>
jmp    1226 <main+0x106>
movb   $0x0,-0x29(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe81(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    119c <main+0x7c>
jp     119c <main+0x7c>
jmp    113c <main+0x1c>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11c0 <main+0xa0>
movb   $0x1,-0x29(%rbp)
movsd  0xe5a(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  0xe41(%rip),%xmm3
divsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
movsd  0xe31(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
cmpb   $0x0,-0x29(%rbp)
je     1210 <main+0xf0>
movsd  0xe0a(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe10(%rip),%rdi
call   1030 <printf@plt>
jmp    113c <main+0x1c>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
movabs $0x3ff0000000000000,%rax
mov    %rax,0x8(%rsp)
lea    0xedd(%rip),%r14
lea    0x8(%rsp),%r15
lea    0x18(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xed3(%rip),%rbx
jmp    11bb <main+0x9b>
nopl   0x0(%rax,%rax,1)
movsd  0x10(%rsp),%xmm0
movsd  0xe9a(%rip),%xmm4
divsd  %xmm4,%xmm0
addsd  0x18(%rsp),%xmm0
divsd  %xmm4,%xmm0
addsd  %xmm2,%xmm0
cmpltsd %xmm3,%xmm1
movapd %xmm1,%xmm2
andnpd %xmm0,%xmm2
xorpd  0xe7b(%rip),%xmm0
andpd  %xmm1,%xmm0
orpd   %xmm2,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
movsd  0xe4d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11bb <main+0x9b>
jnp    1207 <main+0xe7>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm1
ucomisd 0xe26(%rip),%xmm1
jne    11de <main+0xbe>
jnp    1207 <main+0xe7>
xorpd  %xmm3,%xmm3
ucomisd %xmm1,%xmm3
movapd %xmm1,%xmm2
jbe    1160 <main+0x40>
movapd %xmm1,%xmm2
xorpd  0xe14(%rip),%xmm2
movlpd %xmm2,0x8(%rsp)
jmp    1160 <main+0x40>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.1 = [8 x i8] c"\09%.8lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i8
store i32 0, i32* %1
store double 1.000000e+00, double* %2
br label %7
7: ; preds = %34, %14, %0
%8 = load double, double* %2
%9 = fcmp une double %8, -9.990000e+02
br i1 %9, label %10, label %37
10: ; preds = %7
store i8 0, i8* %6
%11 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, double* %4)
%12 = load double, double* %2
%13 = fcmp oeq double %12, -9.990000e+02
br i1 %13, label %14, label %15
14: ; preds = %10
br label %7
15: ; preds = %10
%16 = load double, double* %2
%17 = fcmp olt double %16, 0.000000e+00
br i1 %17, label %18, label %21
18: ; preds = %15
store i8 1, i8* %6
%19 = load double, double* %2
%20 = fmul double %19, -1.000000e+00
store double %20, double* %2
br label %21
21: ; preds = %18, %15
%22 = load double, double* %2
%23 = load double, double* %3
%24 = load double, double* %4
%25 = fdiv double %24, 6.000000e+01
%26 = fadd double %23, %25
%27 = fdiv double %26, 6.000000e+01
%28 = fadd double %22, %27
store double %28, double* %5
%29 = load i8, i8* %6
%30 = icmp ne i8 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %21
%32 = load double, double* %5
%33 = fmul double %32, -1.000000e+00
store double %33, double* %5
br label %34
34: ; preds = %31, %21
%35 = load double, double* %5
%36 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %35)
br label %7
37: ; preds = %7
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.1 = [8 x i8] c"\09%.8lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
store double 1.000000e+00, double* %1
br label %7
7: ; preds = %0, %15
%8 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3)
%9 = load double, double* %1
%10 = fcmp oeq double %9, -9.990000e+02
br i1 %10, label %28, label %11
11: ; preds = %7
%12 = fcmp olt double %9, 0.000000e+00
br i1 %12, label %13, label %15
13: ; preds = %11
%14 = fneg double %9
store double %14, double* %1
br label %15
15: ; preds = %11, %13
%16 = phi double [ %14, %13 ], [ %9, %11 ]
%17 = load double, double* %2
%18 = load double, double* %3
%19 = fdiv double %18, 6.000000e+01
%20 = fadd double %17, %19
%21 = fdiv double %20, 6.000000e+01
%22 = fadd double %16, %21
%23 = fneg double %22
%24 = select i1 %12, double %23, double %22
%25 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %24)
%26 = load double, double* %1
%27 = fcmp une double %26, -9.990000e+02
br i1 %27, label %7, label %28
28: ; preds = %7, %15
ret i32 0
}