#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 */
double fabs(double);
int /*<<< orphan*/ printf(char *, double);
int scanf(char *, ...);
int main() {
  double a, b, angle, temp;
  char ch;
  while (scanf("%lf", &a) == 1) {
    scanf("%c", &ch);
    scanf("%lf", &b);
    if (a == 0 && b == 0)
      break;
    temp = fabs((30.0 * a) - (b * 5.5));
    angle = (360 - temp);
    if (temp < angle)
      angle = temp;
    printf("%.3lf\n", angle);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xefa(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1232 <main+0x112>
lea    0xee3(%rip),%rdi
lea    -0x29(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xecd(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11a3 <main+0x83>
jp     11a3 <main+0x83>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11a3 <main+0x83>
jp     11a3 <main+0x83>
jmp    1232 <main+0x112>
movsd  -0x10(%rbp),%xmm0
movsd  0xe60(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe34(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movaps 0xe3d(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe0c(%rip),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    121c <main+0xfc>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe0f(%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    0xefb(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11fc <main+0xdc>
lea    0xee3(%rip),%r14
lea    0x7(%rsp),%r15
lea    0xed3(%rip),%rbx
lea    0x10(%rsp),%r12
lea    0xece(%rip),%r13
lea    0x8(%rsp),%rbp
jmp    11b6 <main+0x96>
mulsd  0xe88(%rip),%xmm1
mulsd  0xe88(%rip),%xmm0
addsd  %xmm1,%xmm0
andpd  0xe94(%rip),%xmm0
movsd  0xe7c(%rip),%xmm1
subsd  %xmm0,%xmm1
minsd  %xmm1,%xmm0
mov    %r13,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11fc <main+0xdc>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
ucomisd 0xe3a(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
jne    1170 <main+0x50>
jp     1170 <main+0x50>
ucomisd 0xe28(%rip),%xmm1
jne    1170 <main+0x50>
jp     1170 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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