#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 *, int *, int *);
int main() {
  int hour, minute;
  double ang_hour, ang_minute;
  double diff;
  while (scanf("%d:%2d\n", &hour, &minute) != EOF) {
    if (hour == 0.00 && minute == 0.00)
      break;
    ang_hour = 30.00 * hour + 0.50 * minute;
    ang_minute = 6.0 * minute;
    diff = fabs(ang_hour - ang_minute);
    diff = (diff > 180.00) ? 360.00 - diff : diff;
    printf("%0.3lf\n", diff);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf0a(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
je     123b <main+0x11b>
cvtsi2sdl -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1188 <main+0x68>
jp     1188 <main+0x68>
cvtsi2sdl -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1188 <main+0x68>
jp     1188 <main+0x68>
jmp    123b <main+0x11b>
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm2
movsd  0xe7e(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe6a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe48(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movaps 0xe56(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe10(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1211 <main+0xf1>
movsd  0xe1e(%rip),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    121b <main+0xfb>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe17(%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   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xf0c(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%r13
cmp    0x0(%r13),%rax
je     11fd <main+0xdd>
lea    0xeed(%rip),%r14
lea    0xede(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%rbx
nopl   0x0(%rax)
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%ecx
mov    %eax,%edx
or     %ecx,%edx
je     11fd <main+0xdd>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
movapd %xmm1,%xmm2
mulsd  0xe68(%rip),%xmm2
mulsd  0xe68(%rip),%xmm0
addsd  %xmm2,%xmm0
mulsd  0xe64(%rip),%xmm1
addsd  %xmm0,%xmm1
andpd  0xe78(%rip),%xmm1
movsd  0xe58(%rip),%xmm2
subsd  %xmm1,%xmm2
movsd  0xe54(%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
jne    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"%d:%2d\0A\00"
@EOF = global i64 0
@.str.1 = [8 x i8] c"%0.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
br label %7
7: ; preds = %41, %0
%8 = call i64 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %45
11: ; preds = %7
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to double
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i32, i32* %3
%17 = sitofp i32 %16 to double
%18 = fcmp oeq double %17, 0.000000e+00
br i1 %18, label %19, label %20
19: ; preds = %15
br label %45
20: ; preds = %15, %11
%21 = load i32, i32* %2
%22 = sitofp i32 %21 to double
%23 = load i32, i32* %3
%24 = sitofp i32 %23 to double
%25 = fmul double 5.000000e-01, %24
%26 = call double @llvm.fmuladd.f64(double 3.000000e+01, double %22, double %25)
store double %26, double* %4
%27 = load i32, i32* %3
%28 = sitofp i32 %27 to double
%29 = fmul double 6.000000e+00, %28
store double %29, double* %5
%30 = load double, double* %4
%31 = load double, double* %5
%32 = fsub double %30, %31
%33 = call double @llvm.fabs.f64(double %32)
store double %33, double* %6
%34 = load double, double* %6
%35 = fcmp ogt double %34, 1.800000e+02
br i1 %35, label %36, label %39
36: ; preds = %20
%37 = load double, double* %6
%38 = fsub double 3.600000e+02, %37
br label %41
39: ; preds = %20
%40 = load double, double* %6
br label %41
41: ; preds = %39, %36
%42 = phi double [ %38, %36 ], [ %40, %39 ]
store double %42, double* %6
%43 = load double, double* %6
%44 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %43)
br label %7
45: ; preds = %19, %7
ret i32 0
}

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