#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int hh, mm, mins_since_midnight;
  printf("Enter a 24-hour time: ");
  scanf("%2d:%2d", &hh, &mm);
  mins_since_midnight = hh * 60 + mm;
  if (mins_since_midnight <= ((8 * 60) + (103 / 2)))
    printf("Closest departure time is 8:00 a.m., arriving at 10:16 a.m.\n");
  else if (mins_since_midnight < ((9 * 60) + 43) + (96 / 2))
    printf("Closest departure time is 9:43 a.m., arriving at 11:52 a.m.\n");
  else if (mins_since_midnight < ((11 * 60) + 19) + (88 / 2))
    printf("Closest departure time is 11:19 a.m., arriving at 1:31 p.m.\n");
  else if (mins_since_midnight <= ((12 * 60) + 47) + (73 / 2))
    printf("Closest departure time is 12:47 p.m., arriving at 3:00 p.m.\n");
  else if (mins_since_midnight <= ((14 * 60) + (105 / 2)))
    printf("Closest departure time is 2:00 p.m., arriving at 4:08 p.m.\n");
  else if (mins_since_midnight <= ((15 * 60) + 45) + (195 / 2))
    printf("Closest departure time is 3:45 p.m., arriving at 5:55 p.m.\n");
  else if (mins_since_midnight <= ((19 * 60) + (165 / 2)))
    printf("Closest departure time is 7:00 p.m., arriving at 9:20 p.m.\n");
  else
    printf("Closest departure time is 9:45 p.m., arriving at 11:58 p.m.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
imul   $0x3c,-0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x213,-0x10(%rbp)
jg     1177 <main+0x57>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1255 <main+0x135>
cmpl   $0x277,-0x10(%rbp)
jge    1195 <main+0x75>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
jmp    1250 <main+0x130>
cmpl   $0x2d3,-0x10(%rbp)
jge    11b3 <main+0x93>
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
jmp    124b <main+0x12b>
cmpl   $0x323,-0x10(%rbp)
jg     11d1 <main+0xb1>
lea    0xf0f(%rip),%rdi
call   1030 <printf@plt>
jmp    1246 <main+0x126>
cmpl   $0x37c,-0x10(%rbp)
jg     11ef <main+0xcf>
lea    0xf2e(%rip),%rdi
call   1030 <printf@plt>
jmp    1241 <main+0x121>
cmpl   $0x412,-0x10(%rbp)
jg     120d <main+0xed>
lea    0xf4c(%rip),%rdi
call   1030 <printf@plt>
jmp    123c <main+0x11c>
cmpl   $0x4c6,-0x10(%rbp)
jg     122b <main+0x10b>
lea    0xf6a(%rip),%rdi
call   1030 <printf@plt>
jmp    1237 <main+0x117>
lea    0xf95(%rip),%rdi
call   1030 <printf@plt>
jmp    123c <main+0x11c>
jmp    1241 <main+0x121>
jmp    1246 <main+0x126>
jmp    124b <main+0x12b>
jmp    1250 <main+0x130>
jmp    1255 <main+0x135>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
imul   $0x3c,0x4(%rsp),%eax
add    (%rsp),%eax
cmp    $0x214,%eax
jge    1169 <main+0x39>
lea    0x1059(%rip),%rdi
jmp    11d0 <main+0xa0>
cmp    $0x277,%eax
jae    1179 <main+0x49>
lea    0x100d(%rip),%rdi
jmp    11d0 <main+0xa0>
cmp    $0x2d3,%eax
jae    1189 <main+0x59>
lea    0xfc1(%rip),%rdi
jmp    11d0 <main+0xa0>
cmp    $0x324,%eax
jae    1199 <main+0x69>
lea    0xf75(%rip),%rdi
jmp    11d0 <main+0xa0>
cmp    $0x37d,%eax
jae    11a9 <main+0x79>
lea    0xf2a(%rip),%rdi
jmp    11d0 <main+0xa0>
cmp    $0x413,%eax
jae    11b9 <main+0x89>
lea    0xedf(%rip),%rdi
jmp    11d0 <main+0xa0>
cmp    $0x4c7,%eax
lea    0xe96(%rip),%rax
lea    0xe53(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter a 24-hour time: \00"
@.str.1 = [8 x i8] c"%2d:%2d\00"
@.str.2 = [61 x i8] c"Closest departure time is 8:00 a.m., arriving at 10:16 a.m.\0A\00"
@.str.3 = [61 x i8] c"Closest departure time is 9:43 a.m., arriving at 11:52 a.m.\0A\00"
@.str.4 = [61 x i8] c"Closest departure time is 11:19 a.m., arriving at 1:31 p.m.\0A\00"
@.str.5 = [61 x i8] c"Closest departure time is 12:47 p.m., arriving at 3:00 p.m.\0A\00"
@.str.6 = [60 x i8] c"Closest departure time is 2:00 p.m., arriving at 4:08 p.m.\0A\00"
@.str.7 = [60 x i8] c"Closest departure time is 3:45 p.m., arriving at 5:55 p.m.\0A\00"
@.str.8 = [60 x i8] c"Closest departure time is 7:00 p.m., arriving at 9:20 p.m.\0A\00"
@.str.9 = [61 x i8] c"Closest departure time is 9:45 p.m., arriving at 11:58 p.m.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, 60
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp sle i32 %11, 531
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
br label %53
15: ; preds = %0
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 631
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
br label %52
20: ; preds = %15
%21 = load i32, i32* %4
%22 = icmp slt i32 %21, 723
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0))
br label %51
25: ; preds = %20
%26 = load i32, i32* %4
%27 = icmp sle i32 %26, 803
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.5, i64 0, i64 0))
br label %50
30: ; preds = %25
%31 = load i32, i32* %4
%32 = icmp sle i32 %31, 892
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0))
br label %49
35: ; preds = %30
%36 = load i32, i32* %4
%37 = icmp sle i32 %36, 1042
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0))
br label %48
40: ; preds = %35
%41 = load i32, i32* %4
%42 = icmp sle i32 %41, 1222
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0))
br label %47
45: ; preds = %40
%46 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.9, i64 0, i64 0))
br label %47
47: ; preds = %45, %43
br label %48
48: ; preds = %47, %38
br label %49
49: ; preds = %48, %33
br label %50
50: ; preds = %49, %28
br label %51
51: ; preds = %50, %23
br label %52
52: ; preds = %51, %18
br label %53
53: ; preds = %52, %13
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter a 24-hour time: \00"
@.str.1 = [8 x i8] c"%2d:%2d\00"
@str = [60 x i8] c"Closest departure time is 9:45 p.m., arriving at 11:58 p.m.\00"
@str.10 = [59 x i8] c"Closest departure time is 7:00 p.m., arriving at 9:20 p.m.\00"
@str.11 = [59 x i8] c"Closest departure time is 3:45 p.m., arriving at 5:55 p.m.\00"
@str.12 = [59 x i8] c"Closest departure time is 2:00 p.m., arriving at 4:08 p.m.\00"
@str.13 = [60 x i8] c"Closest departure time is 12:47 p.m., arriving at 3:00 p.m.\00"
@str.14 = [60 x i8] c"Closest departure time is 11:19 a.m., arriving at 1:31 p.m.\00"
@str.15 = [60 x i8] c"Closest departure time is 9:43 a.m., arriving at 11:52 a.m.\00"
@str.16 = [60 x i8] c"Closest departure time is 8:00 a.m., arriving at 10:16 a.m.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, 60
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
%11 = icmp slt i32 %10, 532
br i1 %11, label %25, label %12
12: ; preds = %0
%13 = icmp ult i32 %10, 631
br i1 %13, label %25, label %14
14: ; preds = %12
%15 = icmp ult i32 %10, 723
br i1 %15, label %25, label %16
16: ; preds = %14
%17 = icmp ult i32 %10, 804
br i1 %17, label %25, label %18
18: ; preds = %16
%19 = icmp ult i32 %10, 893
br i1 %19, label %25, label %20
20: ; preds = %18
%21 = icmp ult i32 %10, 1043
br i1 %21, label %25, label %22
22: ; preds = %20
%23 = icmp ult i32 %10, 1223
%24 = select i1 %23, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @str.10, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0)
br label %25
25: ; preds = %22, %20, %18, %16, %14, %12, %0
%26 = phi i8* [ getelementptr inbounds ([60 x i8], [60 x i8]* @str.16, i64 0, i64 0), %0 ], [ getelementptr inbounds ([60 x i8], [60 x i8]* @str.15, i64 0, i64 0), %12 ], [ getelementptr inbounds ([60 x i8], [60 x i8]* @str.14, i64 0, i64 0), %14 ], [ getelementptr inbounds ([60 x i8], [60 x i8]* @str.13, i64 0, i64 0), %16 ], [ getelementptr inbounds ([59 x i8], [59 x i8]* @str.12, i64 0, i64 0), %18 ], [ getelementptr inbounds ([59 x i8], [59 x i8]* @str.11, i64 0, i64 0), %20 ], [ %24, %22 ]
%27 = call i32 @puts(i8* dereferenceable(1) %26)
ret i32 0
}