#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 *, int *, int *);
int main() {
  int n1, n2;
  double c1, c2, out;
  while (scanf("%d:%d", &n1, &n2) != EOF) {
    c1 = n1 * 30.0 + n2 / 2.0;
    c2 = n2 * 6.0;
    out = c1 - c2;
    if (out < 0)
      out = -out;
    if (out > 360)
      out -= 360;
    if (out > 180)
      out = 360 - out;
    printf("%0.2f\n", out);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
je     123e <main+0x11e>
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xeab(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xe97(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe75(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    11d2 <main+0xb2>
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe39(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11ff <main+0xdf>
movsd  -0x28(%rbp),%xmm0
movsd  0xe22(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe14(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1228 <main+0x108>
movsd  0xdfa(%rip),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xdfa(%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    0xf1c(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x2e9e(%rip),%r13
cmp    0x0(%r13),%rax
je     1235 <main+0x115>
lea    0xefb(%rip),%r14
lea    0xeee(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x8(%rsp),%rbx
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2sdl 0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x8(%rsp),%xmm1
movapd %xmm1,%xmm2
mulsd  0xe72(%rip),%xmm2
mulsd  0xe72(%rip),%xmm0
addsd  %xmm2,%xmm0
mulsd  0xe6e(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
xorpd  0xe8e(%rip),%xmm0
movapd %xmm1,%xmm2
cmpltsd 0xe71(%rip),%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
movapd %xmm2,%xmm0
addsd  0xe41(%rip),%xmm0
movsd  0xe41(%rip),%xmm3
movapd %xmm3,%xmm1
cmpltsd %xmm2,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm0,%xmm1
movapd %xmm3,%xmm2
subsd  %xmm1,%xmm2
movsd  0xe24(%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 = [6 x i8] c"%d:%d\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"%0.2f\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 ([6 x i8], [6 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 %44
11: ; preds = %7
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to double
%14 = load i32, i32* %3
%15 = sitofp i32 %14 to double
%16 = fdiv double %15, 2.000000e+00
%17 = call double @llvm.fmuladd.f64(double %13, double 3.000000e+01, double %16)
store double %17, double* %4
%18 = load i32, i32* %3
%19 = sitofp i32 %18 to double
%20 = fmul double %19, 6.000000e+00
store double %20, double* %5
%21 = load double, double* %4
%22 = load double, double* %5
%23 = fsub double %21, %22
store double %23, double* %6
%24 = load double, double* %6
%25 = fcmp olt double %24, 0.000000e+00
br i1 %25, label %26, label %29
26: ; preds = %11
%27 = load double, double* %6
%28 = fneg double %27
store double %28, double* %6
br label %29
29: ; preds = %26, %11
%30 = load double, double* %6
%31 = fcmp ogt double %30, 3.600000e+02
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load double, double* %6
%34 = fsub double %33, 3.600000e+02
store double %34, double* %6
br label %35
35: ; preds = %32, %29
%36 = load double, double* %6
%37 = fcmp ogt double %36, 1.800000e+02
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load double, double* %6
%40 = fsub double 3.600000e+02, %39
store double %40, double* %6
br label %41
41: ; preds = %38, %35
%42 = load double, double* %6
%43 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %42)
br label %7
44: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d:%d\00"
@EOF = global i64 0
@.str.1 = [7 x i8] c"%0.2f\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 ([6 x i8], [6 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 %30, label %8
8: ; preds = %0, %8
%9 = load i32, i32* %1
%10 = sitofp i32 %9 to double
%11 = load i32, i32* %2
%12 = sitofp i32 %11 to double
%13 = fmul double %12, 5.000000e-01
%14 = call double @llvm.fmuladd.f64(double %10, double 3.000000e+01, double %13)
%15 = fmul double %12, 6.000000e+00
%16 = fsub double %14, %15
%17 = fcmp olt double %16, 0.000000e+00
%18 = fneg double %16
%19 = select i1 %17, double %18, double %16
%20 = fcmp ogt double %19, 3.600000e+02
%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 ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%28 = load i64, i64* @EOF
%29 = icmp eq i64 %27, %28
br i1 %29, label %30, label %8
30: ; preds = %8, %0
ret i32 0
}