#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 scanf(char *, double *, double *);
int main() {
  double hour, min, ch;
  while (scanf("%lf:%lf", &hour, &min) == 2) {
    if (hour == 0 && min == 0) {
      break;
    } else {
      if (hour >= 1 && hour <= 6) {
        ch = (12 + hour) * 30 - min * (5.5);
      } else {
        ch = (12 - hour) * 30 + min * (5.5);
      }
    }
    if (ch > 180 && ch <= 360) {
      printf("%.3lf\n", 360 - ch);
    } else if (ch > 360) {
      printf("%.3lf\n", ch - 360);
    } else {
      printf("%.3lf\n", ch);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf02(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    12c6 <main+0x1a6>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1181 <main+0x61>
jp     1181 <main+0x61>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1181 <main+0x61>
jp     1181 <main+0x61>
jmp    12c6 <main+0x1a6>
movsd  -0x10(%rbp),%xmm0
movsd  0xe72(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11f6 <main+0xd6>
movsd  0xe68(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11f6 <main+0xd6>
movsd  0xe6d(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xe58(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe2c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1225 <main+0x105>
movsd  0xe22(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xe0d(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xdf8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    122a <main+0x10a>
movsd  -0x20(%rbp),%xmm0
movsd  0xdf1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1272 <main+0x152>
movsd  0xde7(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1272 <main+0x152>
movsd  0xdd4(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
lea    0xdd8(%rip),%rdi
call   1030 <printf@plt>
jmp    12c1 <main+0x1a1>
movsd  -0x20(%rbp),%xmm0
movsd  0xdb1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12ab <main+0x18b>
movsd  -0x20(%rbp),%xmm0
movsd  0xd9a(%rip),%xmm1
subsd  %xmm1,%xmm0
lea    0xd9f(%rip),%rdi
call   1030 <printf@plt>
jmp    12bc <main+0x19c>
movsd  -0x20(%rbp),%xmm0
lea    0xd89(%rip),%rdi
call   1030 <printf@plt>
jmp    12c1 <main+0x1a1>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xf2e(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    1242 <main+0x122>
movsd  0xee6(%rip),%xmm3
lea    0xf0f(%rip),%r14
lea    0xf00(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%rbx
jmp    11a3 <main+0x83>
nopl   0x0(%rax)
movapd %xmm3,%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
movsd  0xe9b(%rip),%xmm3
jne    1242 <main+0x122>
movsd  0x10(%rsp),%xmm0
ucomisd 0xe97(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
jne    11c7 <main+0xa7>
jp     11c7 <main+0xa7>
ucomisd 0xe85(%rip),%xmm1
jne    11c7 <main+0xa7>
jnp    1242 <main+0x122>
ucomisd 0xe31(%rip),%xmm0
setae  %al
movsd  0xe2e(%rip),%xmm2
ucomisd %xmm0,%xmm2
setae  %cl
movsd  0xe27(%rip),%xmm2
test   %cl,%al
jne    11f5 <main+0xd5>
movsd  0xe23(%rip),%xmm2
jne    11ff <main+0xdf>
xorpd  0xe51(%rip),%xmm0
addsd  0xe19(%rip),%xmm0
mulsd  %xmm2,%xmm1
mulsd  0xe15(%rip),%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xe11(%rip),%xmm0
jbe    122b <main+0x10b>
ucomisd %xmm0,%xmm3
jae    1170 <main+0x50>
ucomisd %xmm3,%xmm0
jbe    117c <main+0x5c>
addsd  0xe03(%rip),%xmm0
jmp    117c <main+0x5c>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf:%lf\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
br label %5
5: ; preds = %56, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %57
8: ; preds = %5
%9 = load double, double* %2
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load double, double* %3
%13 = fcmp oeq double %12, 0.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %11
br label %57
15: ; preds = %11, %8
%16 = load double, double* %2
%17 = fcmp oge double %16, 1.000000e+00
br i1 %17, label %18, label %28
18: ; preds = %15
%19 = load double, double* %2
%20 = fcmp ole double %19, 6.000000e+00
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load double, double* %2
%23 = fadd double 1.200000e+01, %22
%24 = load double, double* %3
%25 = fmul double %24, 5.500000e+00
%26 = fneg double %25
%27 = call double @llvm.fmuladd.f64(double %23, double 3.000000e+01, double %26)
store double %27, double* %4
br label %34
28: ; preds = %18, %15
%29 = load double, double* %2
%30 = fsub double 1.200000e+01, %29
%31 = load double, double* %3
%32 = fmul double %31, 5.500000e+00
%33 = call double @llvm.fmuladd.f64(double %30, double 3.000000e+01, double %32)
store double %33, double* %4
br label %34
34: ; preds = %28, %21
br label %35
35: ; preds = %34
%36 = load double, double* %4
%37 = fcmp ogt double %36, 1.800000e+02
br i1 %37, label %38, label %45
38: ; preds = %35
%39 = load double, double* %4
%40 = fcmp ole double %39, 3.600000e+02
br i1 %40, label %41, label %45
41: ; preds = %38
%42 = load double, double* %4
%43 = fsub double 3.600000e+02, %42
%44 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %43)
br label %56
45: ; preds = %38, %35
%46 = load double, double* %4
%47 = fcmp ogt double %46, 3.600000e+02
br i1 %47, label %48, label %52
48: ; preds = %45
%49 = load double, double* %4
%50 = fsub double %49, 3.600000e+02
%51 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %50)
br label %55
52: ; preds = %45
%53 = load double, double* %4
%54 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %53)
br label %55
55: ; preds = %52, %48
br label %56
56: ; preds = %55, %41
br label %5
57: ; preds = %14, %5
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf:%lf\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %37
7: ; preds = %0, %32
%8 = load double, double* %1
%9 = fcmp oeq double %8, 0.000000e+00
%10 = load double, double* %2
%11 = fcmp oeq double %10, 0.000000e+00
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %37, label %13
13: ; preds = %7
%14 = fcmp oge double %8, 1.000000e+00
%15 = fcmp ole double %8, 6.000000e+00
%16 = and i1 %14, %15
%17 = select i1 %16, double -5.500000e+00, double 5.500000e+00
%18 = fneg double %8
%19 = select i1 %16, double %8, double %18
%20 = fadd double %19, 1.200000e+01
%21 = fmul double %10, %17
%22 = call double @llvm.fmuladd.f64(double %20, double 3.000000e+01, double %21)
%23 = fcmp ogt double %22, 1.800000e+02
%24 = fcmp ole double %22, 3.600000e+02
%25 = and i1 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %13
%27 = fsub double 3.600000e+02, %22
br label %32
28: ; preds = %13
%29 = fcmp ogt double %22, 3.600000e+02
br i1 %29, label %30, label %32
30: ; preds = %28
%31 = fadd double %22, -3.600000e+02
br label %32
32: ; preds = %28, %30, %26
%33 = phi double [ %31, %30 ], [ %27, %26 ], [ %22, %28 ]
%34 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %33)
%35 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%36 = icmp eq i32 %35, 2
br i1 %36, label %7, label %37
37: ; preds = %32, %7, %0
ret i32 0
}