#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, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int h1, m1, h2, m2, H, M;
  scanf("%d %d %d %d", &h1, &m1, &h2, &m2);
  if (m1 > m2)
    M = 60 - m1 + m2;
  else
    M = m2 - m1;
  if (h1 == 00)
    h1 = 24;
  else if (h2 == 00)
    h2 = 24;
  if (h2 - h1 == 1 && m2 < m1)
    H = 0;
  else if (h1 == h2)
    H = 24;
  else if (h1 > h2)
    H = 24 - h1 + h2;
  else
    H = h2 - h1;
  printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)\n", H, M);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    117a <main+0x4a>
mov    $0x3c,%eax
sub    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1183 <main+0x53>
mov    -0x14(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1199 <main+0x69>
movl   $0x18,-0x8(%rbp)
jmp    11af <main+0x7f>
cmpl   $0x0,-0x10(%rbp)
jne    11aa <main+0x7a>
movl   $0x18,-0x10(%rbp)
jmp    11af <main+0x7f>
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x1,%eax
jne    11d6 <main+0xa6>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d6 <main+0xa6>
movl   $0x0,-0x18(%rbp)
jmp    1220 <main+0xf0>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11ee <main+0xbe>
movl   $0x18,-0x18(%rbp)
jmp    121b <main+0xeb>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    120d <main+0xdd>
mov    $0x18,%eax
sub    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1216 <main+0xe6>
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    121b <main+0xeb>
jmp    1220 <main+0xf0>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xddf(%rip),%rdi
call   1040 <printf@plt>
lea    0xdfb(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x10(%rsp),%r8
call   1050 <scanf@plt>
mov    0xc(%rsp),%r8d
test   %r8d,%r8d
je     1175 <main+0x45>
mov    0x8(%rsp),%ecx
test   %ecx,%ecx
jne    1187 <main+0x57>
movl   $0x18,0x8(%rsp)
mov    $0x18,%ecx
jmp    1187 <main+0x57>
movl   $0x18,0xc(%rsp)
mov    $0x18,%r8d
mov    0x8(%rsp),%ecx
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%edx
mov    %ecx,%eax
sub    %r8d,%eax
cmp    $0x1,%eax
jne    119f <main+0x6f>
xor    %esi,%esi
cmp    %edi,%edx
jl     11b2 <main+0x82>
mov    $0x18,%esi
sub    %r8d,%ecx
je     11b2 <main+0x82>
mov    %eax,%esi
jge    11b2 <main+0x82>
add    $0x18,%ecx
mov    %ecx,%esi
mov    %edx,%eax
sub    %edi,%eax
add    $0x3c,%eax
sub    %edi,%edx
cmovl  %eax,%edx
lea    0xe47(%rip),%rdi
call   1040 <printf@plt>
lea    0xe63(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [40 x i8] c"O JOGO DUROU %d HORA(S) E %d MINUTO(S)\0A\00"
@.str.2 = [6 x i8] c"pause\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
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %0
%13 = load i32, i32* %3
%14 = sub nsw i32 60, %13
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
store i32 %16, i32* %7
br label %21
17: ; preds = %0
%18 = load i32, i32* %5
%19 = load i32, i32* %3
%20 = sub nsw i32 %18, %19
store i32 %20, i32* %7
br label %21
21: ; preds = %17, %12
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 24, i32* %2
br label %30
25: ; preds = %21
%26 = load i32, i32* %4
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 24, i32* %4
br label %29
29: ; preds = %28, %25
br label %30
30: ; preds = %29, %24
%31 = load i32, i32* %4
%32 = load i32, i32* %2
%33 = sub nsw i32 %31, %32
%34 = icmp eq i32 %33, 1
br i1 %34, label %35, label %40
35: ; preds = %30
%36 = load i32, i32* %5
%37 = load i32, i32* %3
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %40
39: ; preds = %35
store i32 0, i32* %6
br label %60
40: ; preds = %35, %30
%41 = load i32, i32* %2
%42 = load i32, i32* %4
%43 = icmp eq i32 %41, %42
br i1 %43, label %44, label %45
44: ; preds = %40
store i32 24, i32* %6
br label %59
45: ; preds = %40
%46 = load i32, i32* %2
%47 = load i32, i32* %4
%48 = icmp sgt i32 %46, %47
br i1 %48, label %49, label %54
49: ; preds = %45
%50 = load i32, i32* %2
%51 = sub nsw i32 24, %50
%52 = load i32, i32* %4
%53 = add nsw i32 %51, %52
store i32 %53, i32* %6
br label %58
54: ; preds = %45
%55 = load i32, i32* %4
%56 = load i32, i32* %2
%57 = sub nsw i32 %55, %56
store i32 %57, i32* %6
br label %58
58: ; preds = %54, %49
br label %59
59: ; preds = %58, %44
br label %60
60: ; preds = %59, %39
%61 = load i32, i32* %6
%62 = load i32, i32* %7
%63 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %61, i32 %62)
%64 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d %d %d %d\00"
@.str.1 = [40 x i8] c"O JOGO DUROU %d HORA(S) E %d MINUTO(S)\0A\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, %10
%13 = load i32, i32* %1
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %0
store i32 24, i32* %1
%16 = load i32, i32* %3
br label %21
17: ; preds = %0
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 24, i32* %3
br label %21
21: ; preds = %17, %20, %15
%22 = phi i32 [ %13, %17 ], [ %13, %20 ], [ 24, %15 ]
%23 = phi i32 [ %18, %17 ], [ 24, %20 ], [ %16, %15 ]
%24 = sub nsw i32 %23, %22
%25 = icmp ne i32 %24, 1
%26 = xor i1 %12, true
%27 = select i1 %25, i1 true, i1 %26
br i1 %27, label %28, label %35
28: ; preds = %21
%29 = icmp eq i32 %23, %22
br i1 %29, label %35, label %30
30: ; preds = %28
%31 = icmp slt i32 %23, %22
br i1 %31, label %32, label %35
32: ; preds = %30
%33 = add i32 %23, 24
%34 = sub i32 %33, %22
br label %35
35: ; preds = %21, %30, %28, %32
%36 = phi i32 [ %34, %32 ], [ 24, %28 ], [ %24, %30 ], [ 0, %21 ]
%37 = select i1 %12, i32 60, i32 0
%38 = sub i32 %11, %10
%39 = add i32 %38, %37
%40 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %36, i32 %39)
%41 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}