#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 */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
char *calculate_angle(double, double);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int scanf(char *, double *, double *);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  double hh;
  double mm;
  if (argc != 2) {
    printf("Usage: %s INPUT_FILE\n\n", argv[0]);
    exit(-1);
  }
  if (access(argv[1], F_OK)) {
    printf("Error: INPUT_FILE %s does not exist\n\n", argv[1]);
    exit(-1);
  }
  freopen(argv[1], "r", stdin);
  while (scanf("%lf:%lf", &hh, &mm) == 2 && (hh || mm)) {
    printf("%.3lf\n", calculate_angle(hh, mm));
  }
  fclose(stdin);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11ad <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe62(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e14(%rip),%rax
mov    (%rax),%esi
call   1080 <access@plt>
cmp    $0x0,%rax
je     11eb <main+0x7b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe3b(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2dee(%rip),%rax
mov    (%rax),%edx
lea    0xe3a(%rip),%rsi
call   1060 <freopen@plt>
lea    0xe30(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1070 <scanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
mov    %al,-0x21(%rbp)
jne    1266 <main+0xf6>
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x22(%rbp)
jne    1260 <main+0xf0>
jp     1260 <main+0xf0>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1276 <main+0x106>
jmp    1299 <main+0x129>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <calculate_angle@plt>
mov    %rax,%rsi
lea    0xdb8(%rip),%rdi
call   1050 <printf@plt>
jmp    1208 <main+0x98>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
call   1040 <fclose@plt>
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
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    125f <main+0xef>
mov    0x8(%rbx),%rdi
mov    0x2e3c(%rip),%rax
mov    (%rax),%esi
call   1080 <access@plt>
mov    0x8(%rbx),%rcx
test   %rax,%rax
jne    126b <main+0xfb>
mov    0x2e39(%rip),%r13
mov    0x0(%r13),%edx
lea    0xe8b(%rip),%rsi
mov    %rcx,%rdi
call   1060 <freopen@plt>
lea    0xe7e(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1070 <scanf@plt>
cmp    $0x2,%eax
jne    1246 <main+0xd6>
lea    0xe6d(%rip),%r14
lea    0xe5e(%rip),%r15
lea    0x8(%rsp),%r12
mov    %rsp,%rbx
jmp    1223 <main+0xb3>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <calculate_angle@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1070 <scanf@plt>
cmp    $0x2,%eax
jne    1246 <main+0xd6>
movsd  0x8(%rsp),%xmm0
ucomisd 0xdcf(%rip),%xmm0
movsd  (%rsp),%xmm1
jne    1200 <main+0x90>
jp     1200 <main+0x90>
ucomisd 0xdbe(%rip),%xmm1
jne    1200 <main+0x90>
jp     1200 <main+0x90>
mov    0x0(%r13),%edi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    (%rbx),%rsi
lea    0xd9f(%rip),%rdi
jmp    1275 <main+0x105>
lea    0xdad(%rip),%rdi
mov    %rcx,%rsi
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s INPUT_FILE\0A\0A\00"
@F_OK = global i32 0
@.str.1 = [38 x i8] c"Error: INPUT_FILE %s does not exist\0A\0A\00"
@.str.2 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.3 = [8 x i8] c"%lf:%lf\00"
@.str.4 = [7 x i8] c"%.3lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 -1)
unreachable
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = load i32, i32* @F_OK
%21 = call i64 @access(i8* %19, i32 %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %29
23: ; preds = %16
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %26)
%28 = call i32 @exit(i32 -1)
unreachable
29: ; preds = %16
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = load i32, i32* @stdin
%34 = call i32 @freopen(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %48, %29
%36 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double* %6, double* %7)
%37 = icmp eq i32 %36, 2
br i1 %37, label %38, label %46
38: ; preds = %35
%39 = load double, double* %6
%40 = fcmp une double %39, 0.000000e+00
br i1 %40, label %44, label %41
41: ; preds = %38
%42 = load double, double* %7
%43 = fcmp une double %42, 0.000000e+00
br label %44
44: ; preds = %41, %38
%45 = phi i1 [ true, %38 ], [ %43, %41 ]
br label %46
46: ; preds = %44, %35
%47 = phi i1 [ false, %35 ], [ %45, %44 ]
br i1 %47, label %48, label %53
48: ; preds = %46
%49 = load double, double* %6
%50 = load double, double* %7
%51 = call i8* @calculate_angle(double %49, double %50)
%52 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %51)
br label %35
53: ; preds = %46
%54 = load i32, i32* @stdin
%55 = call i32 @fclose(i32 %54)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s INPUT_FILE\0A\0A\00"
@F_OK = global i32 0
@.str.1 = [38 x i8] c"Error: INPUT_FILE %s does not exist\0A\0A\00"
@.str.2 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.3 = [8 x i8] c"%lf:%lf\00"
@.str.4 = [7 x i8] c"%.3lf\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = icmp eq i32 %0, 2
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8*, i8** %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = tail call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = load i32, i32* @F_OK
%16 = tail call i64 @access(i8* %14, i32 %15)
%17 = icmp eq i64 %16, 0
%18 = load i8*, i8** %13
br i1 %17, label %22, label %19
19: ; preds = %12
%20 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%21 = tail call i32 @exit(i32 -1)
unreachable
22: ; preds = %12
%23 = load i32, i32* @stdin
%24 = tail call i32 @freopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 %23)
%25 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double* %3, double* %4)
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %38
27: ; preds = %22, %33
%28 = load double, double* %3
%29 = fcmp une double %28, 0.000000e+00
%30 = load double, double* %4
%31 = fcmp une double %30, 0.000000e+00
%32 = select i1 %29, i1 true, i1 %31
br i1 %32, label %33, label %38
33: ; preds = %27
%34 = call i8* @calculate_angle(double %28, double %30)
%35 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %34)
%36 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double* %3, double* %4)
%37 = icmp eq i32 %36, 2
br i1 %37, label %27, label %38
38: ; preds = %27, %33, %22
%39 = load i32, i32* @stdin
%40 = call i32 @fclose(i32 %39)
ret i32 0
}