#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 goodMod(int, int);
int /*<<< orphan*/ printf(char *, char *, int, int, int, int);
int scanf(char *, char *, int *, int *, int *, int *, int *, int *);
int main() {
  char m[10];
  int d, y, h1, min1, h2, min2, h;
  while (scanf("%s %d %d %d:%d %d:%d", m, &d, &y, &h1, &min1, &h2, &min2) !=
         -1) {
    h = h2 - h1 - ((min2 - min1) % 60 < 0 ? 1 : 0);
    printf("%s %d %d %d hours %d minutes\n", m, d, y, h,
           goodMod(min2 - min1, 60));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rsi
lea    0xeb6(%rip),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
lea    -0x20(%rbp),%r9
lea    -0x24(%rbp),%r10
lea    -0x28(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <scanf@plt>
cmp    $0xffffffff,%eax
je     11f3 <main+0xc3>
mov    -0x24(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x28(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0x44(%rbp),%eax
mov    %edx,%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovl  %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
lea    -0xe(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%edi
sub    -0x20(%rbp),%edi
mov    $0x3c,%esi
call   1040 <goodMod@plt>
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x30(%rbp),%r8d
mov    %eax,%r9d
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0x14(%rsp),%rbp
lea    0x18(%rsp),%rbx
lea    0xeb1(%rip),%rdi
lea    0x1e(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x4(%rsp),%r9
push   %rbp
push   %rbx
call   1050 <scanf@plt>
add    $0x10,%rsp
cmp    $0xffffffff,%eax
je     122b <main+0xfb>
lea    0x1e(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x18(%rsp),%eax
sub    0x8(%rsp),%eax
mov    0x14(%rsp),%ecx
sub    0x4(%rsp),%ecx
movslq %ecx,%rdi
imul   $0xffffffff88888889,%rdi,%rcx
shr    $0x20,%rcx
add    %edi,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%ecx
mov    %edi,%r15d
sub    %ecx,%r15d
sar    $0x1f,%r15d
add    %eax,%r15d
mov    0x10(%rsp),%r12d
mov    0xc(%rsp),%r13d
mov    $0x3c,%esi
call   1040 <goodMod@plt>
lea    0xe30(%rip),%rdi
mov    %r14,%rsi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    %r15d,%r8d
mov    %eax,%r9d
call   1030 <printf@plt>
lea    0xe00(%rip),%rdi
mov    %r14,%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x4(%rsp),%r9
push   %rbp
push   %rbx
call   1050 <scanf@plt>
add    $0x10,%rsp
cmp    $0xffffffff,%eax
jne    1190 <main+0x60>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%s %d %d %d:%d %d:%d\00"
@.str.1 = [30 x i8] c"%s %d %d %d hours %d minutes\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
br label %10
10: ; preds = %14, %0
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%12 = call i32 @scanf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %11, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8)
%13 = icmp ne i32 %12, -1
br i1 %13, label %14, label %35
14: ; preds = %10
%15 = load i32, i32* %7
%16 = load i32, i32* %5
%17 = sub nsw i32 %15, %16
%18 = load i32, i32* %8
%19 = load i32, i32* %6
%20 = sub nsw i32 %18, %19
%21 = srem i32 %20, 60
%22 = icmp slt i32 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 1, i32 0
%25 = sub nsw i32 %17, %24
store i32 %25, i32* %9
%26 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = load i32, i32* %9
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = sub nsw i32 %30, %31
%33 = call i32 @goodMod(i32 %32, i32 60)
%34 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %26, i32 %27, i32 %28, i32 %29, i32 %33)
br label %10
35: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s %d %d %d:%d %d:%d\00"
@.str.1 = [30 x i8] c"%s %d %d %d hours %d minutes\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%9 = bitcast i32* %2 to i8*
%10 = bitcast i32* %3 to i8*
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = call i32 @scanf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7)
%16 = icmp eq i32 %15, -1
br i1 %16, label %33, label %17
17: ; preds = %0, %17
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = sub i32 %18, %19
%21 = load i32, i32* %7
%22 = load i32, i32* %5
%23 = sub nsw i32 %21, %22
%24 = srem i32 %23, 60
%25 = ashr i32 %24, 31
%26 = add i32 %20, %25
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = call i32 @goodMod(i32 %23, i32 60)
%30 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 %27, i32 %28, i32 %26, i32 %29)
%31 = call i32 @scanf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %17
33: ; preds = %17, %0
ret i32 0
}