#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 main(void) {
  int horai, horaf, mini, minf, hora_t, min_t;
  scanf("%d%d", &horai, &mini);
  scanf("%d%d", &horaf, &minf);
  if (horaf - horai > 0) {
    hora_t = horaf - horai;
  } else {
    hora_t = 24 + (horaf - horai);
  }
  if (minf - mini >= 0) {
    min_t = minf - mini;
  } else {
    min_t = 60 + (minf - mini);
    hora_t--;
  }
  printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)\n", hora_t, min_t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
lea    0xeb6(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x0,%eax
jle    1174 <main+0x54>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1180 <main+0x60>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0x18,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x10(%rbp),%eax
cmp    $0x0,%eax
jl     119d <main+0x7d>
mov    -0x14(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11b2 <main+0x92>
mov    -0x14(%rbp),%eax
sub    -0x10(%rbp),%eax
add    $0x3c,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
sub    0xc(%rsp),%eax
lea    0x18(%rax),%ecx
test   %eax,%eax
cmovg  %eax,%ecx
mov    (%rsp),%eax
sub    0x4(%rsp),%eax
lea    0x3c(%rax),%edx
mov    %eax,%esi
sar    $0x1f,%esi
add    %ecx,%esi
test   %eax,%eax
cmovns %eax,%edx
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [40 x i8] c"O JOGO DUROU %d HORA(S) E %d MINUTO(S)\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
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %4)
%9 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %5)
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = sub nsw i32 %10, %11
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %0
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = sub nsw i32 %15, %16
store i32 %17, i32* %6
br label %23
18: ; preds = %0
%19 = load i32, i32* %3
%20 = load i32, i32* %2
%21 = sub nsw i32 %19, %20
%22 = add nsw i32 24, %21
store i32 %22, i32* %6
br label %23
23: ; preds = %18, %14
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = sub nsw i32 %24, %25
%27 = icmp sge i32 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %23
%29 = load i32, i32* %5
%30 = load i32, i32* %4
%31 = sub nsw i32 %29, %30
store i32 %31, i32* %7
br label %39
32: ; preds = %23
%33 = load i32, i32* %5
%34 = load i32, i32* %4
%35 = sub nsw i32 %33, %34
%36 = add nsw i32 60, %35
store i32 %36, i32* %7
%37 = load i32, i32* %6
%38 = add nsw i32 %37, -1
store i32 %38, i32* %6
br label %39
39: ; preds = %32, %28
%40 = load i32, i32* %6
%41 = load i32, i32* %7
%42 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %40, i32 %41)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [40 x i8] c"O JOGO DUROU %d HORA(S) E %d MINUTO(S)\0A\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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %3)
%10 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %4)
%11 = load i32, i32* %2
%12 = load i32, i32* %1
%13 = sub nsw i32 %11, %12
%14 = icmp sgt i32 %13, 0
%15 = add nsw i32 %13, 24
%16 = select i1 %14, i32 %13, i32 %15
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = sub nsw i32 %17, %18
%20 = icmp sgt i32 %19, -1
%21 = add nsw i32 %19, 60
%22 = xor i1 %20, true
%23 = sext i1 %22 to i32
%24 = add nsw i32 %16, %23
%25 = select i1 %20, i32 %19, i32 %21
%26 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %24, i32 %25)
ret i32 0
}