#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 */
scalar_t__ EOF;
double fabs(double);
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, double *, double *);
int main() {
  double h, m;
  double degree;
  while (scanf("%lf:%lf", &h, &m) != EOF) {
    if (h == 0 && m == 0)
      break;
    degree = fabs(m * 6 - h * 30 - 0.5 * m);
    if (degree > 180)
      degree = 360 - degree;
    printf("%.3lf\n", degree);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf0a(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
je     1225 <main+0x105>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1188 <main+0x68>
jp     1188 <main+0x68>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1188 <main+0x68>
jp     1188 <main+0x68>
jmp    1225 <main+0x105>
movsd  -0x18(%rbp),%xmm1
movsd  0xe83(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe57(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xe3a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movaps 0xe53(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe0d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    120f <main+0xef>
movsd  0xe1b(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe2d(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xf0c(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x2ea0(%rip),%r13
cmp    0x0(%r13),%rax
je     1210 <main+0xf0>
lea    0xeef(%rip),%r14
lea    0xee0(%rip),%r15
lea    0x8(%rsp),%r12
mov    %rsp,%rbx
jmp    11dd <main+0xbd>
nopw   0x0(%rax,%rax,1)
mulsd  0xe88(%rip),%xmm0
movapd %xmm1,%xmm2
mulsd  0xe84(%rip),%xmm2
addsd  %xmm0,%xmm2
mulsd  0xe80(%rip),%xmm1
addsd  %xmm2,%xmm1
andpd  0xe94(%rip),%xmm1
movsd  0xe74(%rip),%xmm2
subsd  %xmm1,%xmm2
movsd  0xe70(%rip),%xmm0
cmpltsd %xmm1,%xmm0
andpd  %xmm0,%xmm2
andnpd %xmm1,%xmm0
orpd   %xmm2,%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    0x0(%r13),%rax
je     1210 <main+0xf0>
movsd  0x8(%rsp),%xmm0
ucomisd 0xe3d(%rip),%xmm0
movsd  (%rsp),%xmm1
jne    1170 <main+0x50>
jp     1170 <main+0x50>
ucomisd 0xe24(%rip),%xmm1
jne    1170 <main+0x50>
jp     1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf:%lf\00"
@EOF = global i64 0
@.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 = %30, %0
%6 = call i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%7 = load i64, i64* @EOF
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %33
9: ; preds = %5
%10 = load double, double* %2
%11 = fcmp oeq double %10, 0.000000e+00
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load double, double* %3
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %12
br label %33
16: ; preds = %12, %9
%17 = load double, double* %3
%18 = load double, double* %2
%19 = fmul double %18, 3.000000e+01
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double %17, double 6.000000e+00, double %20)
%22 = load double, double* %3
%23 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %22, double %21)
%24 = call double @llvm.fabs.f64(double %23)
store double %24, double* %4
%25 = load double, double* %4
%26 = fcmp ogt double %25, 1.800000e+02
br i1 %26, label %27, label %30
27: ; preds = %16
%28 = load double, double* %4
%29 = fsub double 3.600000e+02, %28
store double %29, double* %4
br label %30
30: ; preds = %27, %16
%31 = load double, double* %4
%32 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %31)
br label %5
33: ; preds = %15, %5
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf:%lf\00"
@EOF = global i64 0
@.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 i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %26, label %8
8: ; preds = %0, %14
%9 = load double, double* %1
%10 = fcmp oeq double %9, 0.000000e+00
%11 = load double, double* %2
%12 = fcmp oeq double %11, 0.000000e+00
%13 = select i1 %10, i1 %12, i1 false
br i1 %13, label %26, label %14
14: ; preds = %8
%15 = fmul double %9, -3.000000e+01
%16 = call double @llvm.fmuladd.f64(double %11, double 6.000000e+00, double %15)
%17 = call double @llvm.fmuladd.f64(double %11, double -5.000000e-01, double %16)
%18 = call double @llvm.fabs.f64(double %17)
%19 = fcmp ogt double %18, 1.800000e+02
%20 = fsub double 3.600000e+02, %18
%21 = select i1 %19, double %20, double %18
%22 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %21)
%23 = call i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%24 = load i64, i64* @EOF
%25 = icmp eq i64 %23, %24
br i1 %25, label %26, label %8
26: ; preds = %14, %8, %0
ret i32 0
}