#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 */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int toupper(char);
int main(void) {
  int time1 = 480, time2 = 583, time3 = 679, time4 = 767, time5 = 840,
      time6 = 945, time7 = 1140, time8 = 1305;
  int hour, minute;
  char ch;
  printf("enter a 12-hour time:(xx:xx)\n");
  scanf("%d:%d", &hour, &minute);
  while ((ch = getchar()) == ' ') {
    ;
  }
  switch (toupper(ch)) {
  case 'A':
    hour += 0;
    break;
  case 'P':
    hour += 12;
    break;
  }
  printf("24-hour time is: %d:%d\n", hour, minute);
  int time_now = hour * 60 + minute;
  int m1 = ((time1 >= time_now) ? (time1 - time_now) : (time_now - time1)),
      m2 = ((time2 >= time_now) ? (time2 - time_now) : (time_now - time2)),
      m3 = ((time3 >= time_now) ? (time3 - time_now) : (time_now - time3)),
      m4 = ((time4 >= time_now) ? (time4 - time_now) : (time_now - time4)),
      m5 = ((time5 >= time_now) ? (time5 - time_now) : (time_now - time5)),
      m6 = ((time6 >= time_now) ? (time6 - time_now) : (time_now - time6)),
      m7 = ((time7 >= time_now) ? (time7 - time_now) : (time_now - time7)),
      m8 = ((time8 >= time_now) ? (time8 - time_now) : (time_now - time8));
  int min12 = m1 < m2 ? m1 : m2, min34 = m3 < m4 ? m3 : m4,
      min1234 = min12 < min34 ? min12 : min34, min56 = m5 < m6 ? m5 : m6,
      min78 = m7 < m8 ? m7 : m8, min5678 = min56 < min78 ? min56 : min78,
      min = min1234 < min5678 ? min1234 : min5678;
  if (min == m1) {
    printf("closest departure time is 8:00 a.m., arriving at 10:16 a.m.");
  } else if (min == m2) {
    printf("closest departure time is 9:43 a.m., arriving at 11:52 a.m.");
  } else if (min == m3) {
    printf("closest departure time is 11:19 a.m., arriving at 1:31 p.m.\n");
  } else if (min == m4) {
    printf("closest departure time is 12:47 p.m., arriving at 3:00 p.m.\n");
  } else if (min == m5) {
    printf("closest departure time is 2:00 p.m., arriving at 4:08 p.m.\n");
  } else if (min == m6) {
    printf("closest departure time is 3:45 p.m., arriving at 5:55 p.m.\n");
  } else if (min == m7) {
    printf("closest departure time is 7:00 p.m., arriving at 9:20 p.m.\n");
  } else if (min == m8) {
    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    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1e0,-0x8(%rbp)
movl   $0x247,-0xc(%rbp)
movl   $0x2a7,-0x10(%rbp)
movl   $0x2ff,-0x14(%rbp)
movl   $0x348,-0x18(%rbp)
movl   $0x3b1,-0x1c(%rbp)
movl   $0x474,-0x20(%rbp)
movl   $0x519,-0x24(%rbp)
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
call   1060 <scanf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x2d(%rbp)
movsbl %al,%eax
cmp    $0x20,%eax
jne    11c7 <main+0x87>
jmp    11ac <main+0x6c>
movsbl -0x2d(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,%ecx
mov    %ecx,-0x74(%rbp)
sub    $0x41,%eax
je     11f4 <main+0xb4>
jmp    11e3 <main+0xa3>
mov    -0x74(%rbp),%eax
sub    $0x50,%eax
je     1202 <main+0xc2>
jmp    120b <main+0xcb>
mov    -0x28(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x28(%rbp)
jmp    120b <main+0xcb>
mov    -0x28(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
imul   $0x3c,-0x28(%rbp),%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x34(%rbp),%eax
jl     1243 <main+0x103>
mov    -0x8(%rbp),%eax
sub    -0x34(%rbp),%eax
mov    %eax,-0x78(%rbp)
jmp    124c <main+0x10c>
mov    -0x34(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x34(%rbp),%eax
jl     126c <main+0x12c>
mov    -0xc(%rbp),%eax
sub    -0x34(%rbp),%eax
mov    %eax,-0x7c(%rbp)
jmp    1275 <main+0x135>
mov    -0x34(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x34(%rbp),%eax
jl     1295 <main+0x155>
mov    -0x10(%rbp),%eax
sub    -0x34(%rbp),%eax
mov    %eax,-0x80(%rbp)
jmp    129e <main+0x15e>
mov    -0x34(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x80(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x34(%rbp),%eax
jl     12c1 <main+0x181>
mov    -0x14(%rbp),%eax
sub    -0x34(%rbp),%eax
mov    %eax,-0x84(%rbp)
jmp    12cd <main+0x18d>
mov    -0x34(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x34(%rbp),%eax
jl     12f3 <main+0x1b3>
mov    -0x18(%rbp),%eax
sub    -0x34(%rbp),%eax
mov    %eax,-0x88(%rbp)
jmp    12ff <main+0x1bf>
mov    -0x34(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jl     1325 <main+0x1e5>
mov    -0x1c(%rbp),%eax
sub    -0x34(%rbp),%eax
mov    %eax,-0x8c(%rbp)
jmp    1331 <main+0x1f1>
mov    -0x34(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x34(%rbp),%eax
jl     1357 <main+0x217>
mov    -0x20(%rbp),%eax
sub    -0x34(%rbp),%eax
mov    %eax,-0x90(%rbp)
jmp    1363 <main+0x223>
mov    -0x34(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x90(%rbp)
mov    -0x90(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x34(%rbp),%eax
jl     1389 <main+0x249>
mov    -0x24(%rbp),%eax
sub    -0x34(%rbp),%eax
mov    %eax,-0x94(%rbp)
jmp    1395 <main+0x255>
mov    -0x34(%rbp),%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x94(%rbp)
mov    -0x94(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    13b8 <main+0x278>
mov    -0x38(%rbp),%eax
mov    %eax,-0x98(%rbp)
jmp    13c1 <main+0x281>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x98(%rbp)
mov    -0x98(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    13e4 <main+0x2a4>
mov    -0x40(%rbp),%eax
mov    %eax,-0x9c(%rbp)
jmp    13ed <main+0x2ad>
mov    -0x44(%rbp),%eax
mov    %eax,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jge    1410 <main+0x2d0>
mov    -0x58(%rbp),%eax
mov    %eax,-0xa0(%rbp)
jmp    1419 <main+0x2d9>
mov    -0x5c(%rbp),%eax
mov    %eax,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    143c <main+0x2fc>
mov    -0x48(%rbp),%eax
mov    %eax,-0xa4(%rbp)
jmp    1445 <main+0x305>
mov    -0x4c(%rbp),%eax
mov    %eax,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    1468 <main+0x328>
mov    -0x50(%rbp),%eax
mov    %eax,-0xa8(%rbp)
jmp    1471 <main+0x331>
mov    -0x54(%rbp),%eax
mov    %eax,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x68(%rbp),%eax
jge    1494 <main+0x354>
mov    -0x64(%rbp),%eax
mov    %eax,-0xac(%rbp)
jmp    149d <main+0x35d>
mov    -0x68(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    -0xac(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x60(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jge    14c0 <main+0x380>
mov    -0x60(%rbp),%eax
mov    %eax,-0xb0(%rbp)
jmp    14c9 <main+0x389>
mov    -0x6c(%rbp),%eax
mov    %eax,-0xb0(%rbp)
mov    -0xb0(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    -0x38(%rbp),%eax
jne    14f1 <main+0x3b1>
lea    0xb57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15e8 <main+0x4a8>
mov    -0x70(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jne    1510 <main+0x3d0>
lea    0xb74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15e3 <main+0x4a3>
mov    -0x70(%rbp),%eax
cmp    -0x40(%rbp),%eax
jne    152f <main+0x3ef>
lea    0xb91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15de <main+0x49e>
mov    -0x70(%rbp),%eax
cmp    -0x44(%rbp),%eax
jne    154e <main+0x40e>
lea    0xbaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15d9 <main+0x499>
mov    -0x70(%rbp),%eax
cmp    -0x48(%rbp),%eax
jne    156d <main+0x42d>
lea    0xbcd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15d4 <main+0x494>
mov    -0x70(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jne    158c <main+0x44c>
lea    0xbea(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15cf <main+0x48f>
mov    -0x70(%rbp),%eax
cmp    -0x50(%rbp),%eax
jne    15ab <main+0x46b>
lea    0xc07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15ca <main+0x48a>
mov    -0x70(%rbp),%eax
cmp    -0x54(%rbp),%eax
jne    15c5 <main+0x485>
lea    0xc24(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15ca <main+0x48a>
jmp    15cf <main+0x48f>
jmp    15d4 <main+0x494>
jmp    15d9 <main+0x499>
jmp    15de <main+0x49e>
jmp    15e3 <main+0x4a3>
jmp    15e8 <main+0x4a8>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xffe(%rip),%rdi
call   1040 <puts@plt>
lea    0xf5c(%rip),%rdi
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1070 <scanf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0x20,%al
je     1180 <main+0x30>
movsbl %al,%edi
call   1030 <toupper@plt>
mov    (%rsp),%esi
cmp    $0x50,%eax
jne    11a1 <main+0x51>
add    $0xc,%esi
mov    %esi,(%rsp)
mov    0x4(%rsp),%edx
lea    0xf1a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
imul   $0x3c,(%rsp),%eax
add    0x4(%rsp),%eax
movd   %eax,%xmm0
pshufd $0x50,%xmm0,%xmm4
movdqa 0xe34(%rip),%xmm0
pcmpgtd %xmm4,%xmm0
movdqa 0xe38(%rip),%xmm1
psubd  %xmm4,%xmm1
movdqa 0xe3c(%rip),%xmm2
paddd  %xmm4,%xmm2
pand   %xmm0,%xmm1
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
movd   %xmm0,%eax
movdqa 0xe30(%rip),%xmm1
pcmpgtd %xmm4,%xmm1
movdqa 0xe34(%rip),%xmm2
psubd  %xmm4,%xmm2
movdqa 0xe38(%rip),%xmm3
paddd  %xmm4,%xmm3
pand   %xmm1,%xmm2
pandn  %xmm3,%xmm1
por    %xmm2,%xmm1
movdqa 0xe30(%rip),%xmm2
pcmpgtd %xmm4,%xmm2
movdqa 0xe34(%rip),%xmm3
psubd  %xmm4,%xmm3
movdqa 0xe38(%rip),%xmm5
paddd  %xmm4,%xmm5
pand   %xmm2,%xmm3
pandn  %xmm5,%xmm2
por    %xmm3,%xmm2
movdqa 0xe30(%rip),%xmm3
pcmpgtd %xmm4,%xmm3
movdqa 0xe34(%rip),%xmm5
psubd  %xmm4,%xmm5
paddd  0xe38(%rip),%xmm4
pand   %xmm3,%xmm5
pandn  %xmm4,%xmm3
por    %xmm5,%xmm3
movdqa %xmm1,%xmm4
pcmpgtd %xmm0,%xmm4
movdqa %xmm0,%xmm5
pand   %xmm4,%xmm5
pandn  %xmm1,%xmm4
por    %xmm5,%xmm4
movdqa %xmm3,%xmm5
pcmpgtd %xmm2,%xmm5
movdqa %xmm2,%xmm6
pand   %xmm5,%xmm6
pandn  %xmm3,%xmm5
por    %xmm6,%xmm5
movdqa %xmm5,%xmm6
pcmpgtd %xmm4,%xmm6
pand   %xmm6,%xmm4
pandn  %xmm5,%xmm6
por    %xmm4,%xmm6
movd   %xmm6,%edx
pshufd $0x55,%xmm6,%xmm4
movd   %xmm4,%ecx
cmp    %ecx,%edx
cmovl  %edx,%ecx
cmp    %eax,%ecx
jne    12e7 <main+0x197>
lea    0xdf9(%rip),%rdi
jmp    12f6 <main+0x1a6>
movd   %xmm1,%eax
cmp    %eax,%ecx
jne    12ff <main+0x1af>
lea    0xe24(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    137c <main+0x22c>
movd   %xmm2,%eax
cmp    %eax,%ecx
jne    1310 <main+0x1c0>
lea    0xf8e(%rip),%rdi
jmp    1377 <main+0x227>
movd   %xmm3,%eax
cmp    %eax,%ecx
jne    1321 <main+0x1d1>
lea    0xf41(%rip),%rdi
jmp    1377 <main+0x227>
pshufd $0x55,%xmm0,%xmm0
movd   %xmm0,%eax
cmp    %eax,%ecx
jne    1337 <main+0x1e7>
lea    0xef0(%rip),%rdi
jmp    1377 <main+0x227>
pshufd $0x55,%xmm1,%xmm0
movd   %xmm0,%eax
cmp    %eax,%ecx
jne    134d <main+0x1fd>
lea    0xe9f(%rip),%rdi
jmp    1377 <main+0x227>
pshufd $0x55,%xmm2,%xmm0
movd   %xmm0,%eax
cmp    %eax,%ecx
jne    1363 <main+0x213>
lea    0xe4e(%rip),%rdi
jmp    1377 <main+0x227>
pshufd $0x55,%xmm3,%xmm0
movd   %xmm0,%eax
cmp    %eax,%ecx
jne    137c <main+0x22c>
lea    0xdfc(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"enter a 12-hour time:(xx:xx)\0A\00"
@.str.1 = [6 x i8] c"%d:%d\00"
@.str.2 = [24 x i8] c"24-hour time is: %d:%d\0A\00"
@.str.3 = [60 x i8] c"closest departure time is 8:00 a.m., arriving at 10:16 a.m.\00"
@.str.4 = [60 x i8] c"closest departure time is 9:43 a.m., arriving at 11:52 a.m.\00"
@.str.5 = [61 x i8] c"closest departure time is 11:19 a.m., arriving at 1:31 p.m.\0A\00"
@.str.6 = [61 x i8] c"closest departure time is 12:47 p.m., arriving at 3:00 p.m.\0A\00"
@.str.7 = [60 x i8] c"closest departure time is 2:00 p.m., arriving at 4:08 p.m.\0A\00"
@.str.8 = [60 x i8] c"closest departure time is 3:45 p.m., arriving at 5:55 p.m.\0A\00"
@.str.9 = [60 x i8] c"closest departure time is 7:00 p.m., arriving at 9:20 p.m.\0A\00"
@.str.10 = [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
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
store i32 0, i32* %1
store i32 480, i32* %2
store i32 583, i32* %3
store i32 679, i32* %4
store i32 767, i32* %5
store i32 840, i32* %6
store i32 945, i32* %7
store i32 1140, i32* %8
store i32 1305, i32* %9
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%30 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %10, i32* %11)
br label %31
31: ; preds = %35, %0
%32 = call signext i8 (...) @getchar()
store i8 %32, i8* %12
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 32
br i1 %34, label %35, label %36
35: ; preds = %31
br label %31
36: ; preds = %31
%37 = load i8, i8* %12
%38 = call i32 @toupper(i8 signext %37)
switch i32 %38, label %45 [
i32 65, label %39
i32 80, label %42
]
39: ; preds = %36
%40 = load i32, i32* %10
%41 = add nsw i32 %40, 0
store i32 %41, i32* %10
br label %45
42: ; preds = %36
%43 = load i32, i32* %10
%44 = add nsw i32 %43, 12
store i32 %44, i32* %10
br label %45
45: ; preds = %36, %42, %39
%46 = load i32, i32* %10
%47 = load i32, i32* %11
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %46, i32 %47)
%49 = load i32, i32* %10
%50 = mul nsw i32 %49, 60
%51 = load i32, i32* %11
%52 = add nsw i32 %50, %51
store i32 %52, i32* %13
%53 = load i32, i32* %2
%54 = load i32, i32* %13
%55 = icmp sge i32 %53, %54
br i1 %55, label %56, label %60
56: ; preds = %45
%57 = load i32, i32* %2
%58 = load i32, i32* %13
%59 = sub nsw i32 %57, %58
br label %64
60: ; preds = %45
%61 = load i32, i32* %13
%62 = load i32, i32* %2
%63 = sub nsw i32 %61, %62
br label %64
64: ; preds = %60, %56
%65 = phi i32 [ %59, %56 ], [ %63, %60 ]
store i32 %65, i32* %14
%66 = load i32, i32* %3
%67 = load i32, i32* %13
%68 = icmp sge i32 %66, %67
br i1 %68, label %69, label %73
69: ; preds = %64
%70 = load i32, i32* %3
%71 = load i32, i32* %13
%72 = sub nsw i32 %70, %71
br label %77
73: ; preds = %64
%74 = load i32, i32* %13
%75 = load i32, i32* %3
%76 = sub nsw i32 %74, %75
br label %77
77: ; preds = %73, %69
%78 = phi i32 [ %72, %69 ], [ %76, %73 ]
store i32 %78, i32* %15
%79 = load i32, i32* %4
%80 = load i32, i32* %13
%81 = icmp sge i32 %79, %80
br i1 %81, label %82, label %86
82: ; preds = %77
%83 = load i32, i32* %4
%84 = load i32, i32* %13
%85 = sub nsw i32 %83, %84
br label %90
86: ; preds = %77
%87 = load i32, i32* %13
%88 = load i32, i32* %4
%89 = sub nsw i32 %87, %88
br label %90
90: ; preds = %86, %82
%91 = phi i32 [ %85, %82 ], [ %89, %86 ]
store i32 %91, i32* %16
%92 = load i32, i32* %5
%93 = load i32, i32* %13
%94 = icmp sge i32 %92, %93
br i1 %94, label %95, label %99
95: ; preds = %90
%96 = load i32, i32* %5
%97 = load i32, i32* %13
%98 = sub nsw i32 %96, %97
br label %103
99: ; preds = %90
%100 = load i32, i32* %13
%101 = load i32, i32* %5
%102 = sub nsw i32 %100, %101
br label %103
103: ; preds = %99, %95
%104 = phi i32 [ %98, %95 ], [ %102, %99 ]
store i32 %104, i32* %17
%105 = load i32, i32* %6
%106 = load i32, i32* %13
%107 = icmp sge i32 %105, %106
br i1 %107, label %108, label %112
108: ; preds = %103
%109 = load i32, i32* %6
%110 = load i32, i32* %13
%111 = sub nsw i32 %109, %110
br label %116
112: ; preds = %103
%113 = load i32, i32* %13
%114 = load i32, i32* %6
%115 = sub nsw i32 %113, %114
br label %116
116: ; preds = %112, %108
%117 = phi i32 [ %111, %108 ], [ %115, %112 ]
store i32 %117, i32* %18
%118 = load i32, i32* %7
%119 = load i32, i32* %13
%120 = icmp sge i32 %118, %119
br i1 %120, label %121, label %125
121: ; preds = %116
%122 = load i32, i32* %7
%123 = load i32, i32* %13
%124 = sub nsw i32 %122, %123
br label %129
125: ; preds = %116
%126 = load i32, i32* %13
%127 = load i32, i32* %7
%128 = sub nsw i32 %126, %127
br label %129
129: ; preds = %125, %121
%130 = phi i32 [ %124, %121 ], [ %128, %125 ]
store i32 %130, i32* %19
%131 = load i32, i32* %8
%132 = load i32, i32* %13
%133 = icmp sge i32 %131, %132
br i1 %133, label %134, label %138
134: ; preds = %129
%135 = load i32, i32* %8
%136 = load i32, i32* %13
%137 = sub nsw i32 %135, %136
br label %142
138: ; preds = %129
%139 = load i32, i32* %13
%140 = load i32, i32* %8
%141 = sub nsw i32 %139, %140
br label %142
142: ; preds = %138, %134
%143 = phi i32 [ %137, %134 ], [ %141, %138 ]
store i32 %143, i32* %20
%144 = load i32, i32* %9
%145 = load i32, i32* %13
%146 = icmp sge i32 %144, %145
br i1 %146, label %147, label %151
147: ; preds = %142
%148 = load i32, i32* %9
%149 = load i32, i32* %13
%150 = sub nsw i32 %148, %149
br label %155
151: ; preds = %142
%152 = load i32, i32* %13
%153 = load i32, i32* %9
%154 = sub nsw i32 %152, %153
br label %155
155: ; preds = %151, %147
%156 = phi i32 [ %150, %147 ], [ %154, %151 ]
store i32 %156, i32* %21
%157 = load i32, i32* %14
%158 = load i32, i32* %15
%159 = icmp slt i32 %157, %158
br i1 %159, label %160, label %162
160: ; preds = %155
%161 = load i32, i32* %14
br label %164
162: ; preds = %155
%163 = load i32, i32* %15
br label %164
164: ; preds = %162, %160
%165 = phi i32 [ %161, %160 ], [ %163, %162 ]
store i32 %165, i32* %22
%166 = load i32, i32* %16
%167 = load i32, i32* %17
%168 = icmp slt i32 %166, %167
br i1 %168, label %169, label %171
169: ; preds = %164
%170 = load i32, i32* %16
br label %173
171: ; preds = %164
%172 = load i32, i32* %17
br label %173
173: ; preds = %171, %169
%174 = phi i32 [ %170, %169 ], [ %172, %171 ]
store i32 %174, i32* %23
%175 = load i32, i32* %22
%176 = load i32, i32* %23
%177 = icmp slt i32 %175, %176
br i1 %177, label %178, label %180
178: ; preds = %173
%179 = load i32, i32* %22
br label %182
180: ; preds = %173
%181 = load i32, i32* %23
br label %182
182: ; preds = %180, %178
%183 = phi i32 [ %179, %178 ], [ %181, %180 ]
store i32 %183, i32* %24
%184 = load i32, i32* %18
%185 = load i32, i32* %19
%186 = icmp slt i32 %184, %185
br i1 %186, label %187, label %189
187: ; preds = %182
%188 = load i32, i32* %18
br label %191
189: ; preds = %182
%190 = load i32, i32* %19
br label %191
191: ; preds = %189, %187
%192 = phi i32 [ %188, %187 ], [ %190, %189 ]
store i32 %192, i32* %25
%193 = load i32, i32* %20
%194 = load i32, i32* %21
%195 = icmp slt i32 %193, %194
br i1 %195, label %196, label %198
196: ; preds = %191
%197 = load i32, i32* %20
br label %200
198: ; preds = %191
%199 = load i32, i32* %21
br label %200
200: ; preds = %198, %196
%201 = phi i32 [ %197, %196 ], [ %199, %198 ]
store i32 %201, i32* %26
%202 = load i32, i32* %25
%203 = load i32, i32* %26
%204 = icmp slt i32 %202, %203
br i1 %204, label %205, label %207
205: ; preds = %200
%206 = load i32, i32* %25
br label %209
207: ; preds = %200
%208 = load i32, i32* %26
br label %209
209: ; preds = %207, %205
%210 = phi i32 [ %206, %205 ], [ %208, %207 ]
store i32 %210, i32* %27
%211 = load i32, i32* %24
%212 = load i32, i32* %27
%213 = icmp slt i32 %211, %212
br i1 %213, label %214, label %216
214: ; preds = %209
%215 = load i32, i32* %24
br label %218
216: ; preds = %209
%217 = load i32, i32* %27
br label %218
218: ; preds = %216, %214
%219 = phi i32 [ %215, %214 ], [ %217, %216 ]
store i32 %219, i32* %28
%220 = load i32, i32* %28
%221 = load i32, i32* %14
%222 = icmp eq i32 %220, %221
br i1 %222, label %223, label %225
223: ; preds = %218
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0))
br label %274
225: ; preds = %218
%226 = load i32, i32* %28
%227 = load i32, i32* %15
%228 = icmp eq i32 %226, %227
br i1 %228, label %229, label %231
229: ; preds = %225
%230 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
br label %273
231: ; preds = %225
%232 = load i32, i32* %28
%233 = load i32, i32* %16
%234 = icmp eq i32 %232, %233
br i1 %234, label %235, label %237
235: ; preds = %231
%236 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.5, i64 0, i64 0))
br label %272
237: ; preds = %231
%238 = load i32, i32* %28
%239 = load i32, i32* %17
%240 = icmp eq i32 %238, %239
br i1 %240, label %241, label %243
241: ; preds = %237
%242 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.6, i64 0, i64 0))
br label %271
243: ; preds = %237
%244 = load i32, i32* %28
%245 = load i32, i32* %18
%246 = icmp eq i32 %244, %245
br i1 %246, label %247, label %249
247: ; preds = %243
%248 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0))
br label %270
249: ; preds = %243
%250 = load i32, i32* %28
%251 = load i32, i32* %19
%252 = icmp eq i32 %250, %251
br i1 %252, label %253, label %255
253: ; preds = %249
%254 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0))
br label %269
255: ; preds = %249
%256 = load i32, i32* %28
%257 = load i32, i32* %20
%258 = icmp eq i32 %256, %257
br i1 %258, label %259, label %261
259: ; preds = %255
%260 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.9, i64 0, i64 0))
br label %268
261: ; preds = %255
%262 = load i32, i32* %28
%263 = load i32, i32* %21
%264 = icmp eq i32 %262, %263
br i1 %264, label %265, label %267
265: ; preds = %261
%266 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.10, i64 0, i64 0))
br label %267
267: ; preds = %265, %261
br label %268
268: ; preds = %267, %259
br label %269
269: ; preds = %268, %253
br label %270
270: ; preds = %269, %247
br label %271
271: ; preds = %270, %241
br label %272
272: ; preds = %271, %235
br label %273
273: ; preds = %272, %229
br label %274
274: ; preds = %273, %223
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d:%d\00"
@.str.2 = [24 x i8] c"24-hour time is: %d:%d\0A\00"
@.str.3 = [60 x i8] c"closest departure time is 8:00 a.m., arriving at 10:16 a.m.\00"
@.str.4 = [60 x i8] c"closest departure time is 9:43 a.m., arriving at 11:52 a.m.\00"
@str = [29 x i8] c"enter a 12-hour time:(xx:xx)\00"
@str.11 = [60 x i8] c"closest departure time is 9:45 p.m., arriving at 11:58 p.m.\00"
@str.12 = [59 x i8] c"closest departure time is 7:00 p.m., arriving at 9:20 p.m.\00"
@str.13 = [59 x i8] c"closest departure time is 3:45 p.m., arriving at 5:55 p.m.\00"
@str.14 = [59 x i8] c"closest departure time is 2:00 p.m., arriving at 4:08 p.m.\00"
@str.15 = [60 x i8] c"closest departure time is 12:47 p.m., arriving at 3:00 p.m.\00"
@str.16 = [60 x i8] c"closest departure time is 11:19 a.m., arriving at 1:31 p.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 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
br label %7
7: ; preds = %7, %0
%8 = call signext i8 (...) @getchar()
%9 = icmp eq i8 %8, 32
br i1 %9, label %7, label %10
10: ; preds = %7
%11 = call i32 @toupper(i8 signext %8)
%12 = icmp eq i32 %11, 80
%13 = load i32, i32* %1
br i1 %12, label %14, label %16
14: ; preds = %10
%15 = add nsw i32 %13, 12
store i32 %15, i32* %1
br label %16
16: ; preds = %10, %14
%17 = phi i32 [ %15, %14 ], [ %13, %10 ]
%18 = load i32, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 %18)
%20 = load i32, i32* %1
%21 = mul nsw i32 %20, 60
%22 = load i32, i32* %2
%23 = add nsw i32 %21, %22
%24 = insertelement <2 x i32> poison, i32 %23, i64 0
%25 = shufflevector <2 x i32> %24, <2 x i32> poison, <2 x i32> zeroinitializer
%26 = icmp slt <2 x i32> %25, <i32 481, i32 841>
%27 = sub nsw <2 x i32> <i32 480, i32 840>, %25
%28 = add nsw <2 x i32> %25, <i32 -480, i32 -840>
%29 = select <2 x i1> %26, <2 x i32> %27, <2 x i32> %28
%30 = icmp slt <2 x i32> %25, <i32 584, i32 946>
%31 = sub nsw <2 x i32> <i32 583, i32 945>, %25
%32 = add nsw <2 x i32> %25, <i32 -583, i32 -945>
%33 = select <2 x i1> %30, <2 x i32> %31, <2 x i32> %32
%34 = icmp slt <2 x i32> %25, <i32 680, i32 1141>
%35 = sub nsw <2 x i32> <i32 679, i32 1140>, %25
%36 = add nsw <2 x i32> %25, <i32 -679, i32 -1140>
%37 = select <2 x i1> %34, <2 x i32> %35, <2 x i32> %36
%38 = icmp slt <2 x i32> %25, <i32 768, i32 1306>
%39 = sub nsw <2 x i32> <i32 767, i32 1305>, %25
%40 = add nsw <2 x i32> %25, <i32 -767, i32 -1305>
%41 = select <2 x i1> %38, <2 x i32> %39, <2 x i32> %40
%42 = icmp slt <2 x i32> %29, %33
%43 = select <2 x i1> %42, <2 x i32> %29, <2 x i32> %33
%44 = icmp slt <2 x i32> %37, %41
%45 = select <2 x i1> %44, <2 x i32> %37, <2 x i32> %41
%46 = icmp slt <2 x i32> %43, %45
%47 = select <2 x i1> %46, <2 x i32> %43, <2 x i32> %45
%48 = extractelement <2 x i32> %47, i64 0
%49 = extractelement <2 x i32> %47, i64 1
%50 = icmp slt i32 %48, %49
%51 = select i1 %50, i32 %48, i32 %49
%52 = extractelement <2 x i32> %29, i64 0
%53 = icmp eq i32 %51, %52
br i1 %53, label %54, label %56
54: ; preds = %16
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0))
br label %91
56: ; preds = %16
%57 = extractelement <2 x i32> %33, i64 0
%58 = icmp eq i32 %51, %57
br i1 %58, label %59, label %61
59: ; preds = %56
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
br label %91
61: ; preds = %56
%62 = extractelement <2 x i32> %37, i64 0
%63 = icmp eq i32 %51, %62
br i1 %63, label %64, label %66
64: ; preds = %61
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.16, i64 0, i64 0))
br label %91
66: ; preds = %61
%67 = extractelement <2 x i32> %41, i64 0
%68 = icmp eq i32 %51, %67
br i1 %68, label %69, label %71
69: ; preds = %66
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.15, i64 0, i64 0))
br label %91
71: ; preds = %66
%72 = extractelement <2 x i32> %29, i64 1
%73 = icmp eq i32 %51, %72
br i1 %73, label %74, label %76
74: ; preds = %71
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.14, i64 0, i64 0))
br label %91
76: ; preds = %71
%77 = extractelement <2 x i32> %33, i64 1
%78 = icmp eq i32 %51, %77
br i1 %78, label %79, label %81
79: ; preds = %76
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.13, i64 0, i64 0))
br label %91
81: ; preds = %76
%82 = extractelement <2 x i32> %37, i64 1
%83 = icmp eq i32 %51, %82
br i1 %83, label %84, label %86
84: ; preds = %81
%85 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.12, i64 0, i64 0))
br label %91
86: ; preds = %81
%87 = extractelement <2 x i32> %41, i64 1
%88 = icmp eq i32 %51, %87
br i1 %88, label %89, label %91
89: ; preds = %86
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.11, i64 0, i64 0))
br label %91
91: ; preds = %59, %69, %79, %86, %89, %84, %74, %64, %54
ret i32 0
}