#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;
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, double *, char *, double *);
int main() {
  double time, angle, hour, min;
  char a;
  while (scanf("%lf %c %lf", &hour, &a, &min) != EOF) {
    if (hour == 0.00 && min == 0.00)
      break;
    angle = (min * 6) - (hour * 30) - (min / 2);
    if (angle < 0)
      angle = 360 + angle;
    if (angle > 180)
      angle = 360 - angle;
    printf("%.3lf\n", angle);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef2(%rip),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x29(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <scanf@plt>
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
je     123e <main+0x11e>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    118c <main+0x6c>
jp     118c <main+0x6c>
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    118c <main+0x6c>
jp     118c <main+0x6c>
jmp    123e <main+0x11e>
movsd  -0x28(%rbp),%xmm0
movsd  0xe77(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe4b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xe2e(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    11ff <main+0xdf>
movsd  0xe23(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe14(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1228 <main+0x108>
movsd  0xdfa(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xdff(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xef3(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x7(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x2e98(%rip),%rbp
cmp    0x0(%rbp),%rax
je     1239 <main+0x119>
xorpd  %xmm3,%xmm3
lea    0xece(%rip),%r14
lea    0xebc(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x7(%rsp),%r13
lea    0x8(%rsp),%rbx
jmp    120d <main+0xed>
mulsd  0xe78(%rip),%xmm1
movapd %xmm0,%xmm2
mulsd  0xe74(%rip),%xmm2
addsd  %xmm1,%xmm2
mulsd  0xe70(%rip),%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,%xmm1
movsd  0xe68(%rip),%xmm4
addsd  %xmm4,%xmm1
movapd %xmm0,%xmm2
cmpltsd %xmm3,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm4,%xmm1
subsd  %xmm2,%xmm1
movsd  0xe47(%rip),%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
call   1040 <scanf@plt>
xorpd  %xmm3,%xmm3
cmp    0x0(%rbp),%rax
je     1239 <main+0x119>
movsd  0x10(%rsp),%xmm1
ucomisd %xmm3,%xmm1
movsd  0x8(%rsp),%xmm0
jne    1180 <main+0x60>
jp     1180 <main+0x60>
ucomisd %xmm3,%xmm0
jne    1180 <main+0x60>
jp     1180 <main+0x60>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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