#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 abs(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ system(char *);
int main() {
  int d, h, m, s, d1, h1, m1, s1, d2, h2, m2, s2;
  char a[3], b, c;
  scanf("%s %d", &a, &d1);
  scanf("%d %c %d %c %d", &h1, &b, &m1, &c, &s1);
  scanf("%s %d", &a, &d2);
  scanf("%d %c %d %c %d", &h2, &b, &m2, &c, &s2);
  d = d2 - d1;
  h = 24 - h1 + h2;
  if (h == 24)
    h = 0;
  if (h != 0)
    d = d - 1;
  m = abs(m2 - m1);
  s = abs(s2 - s1);
  printf("%d dia(s)\n", d);
  printf("%d hora(s)\n", h);
  printf("%d minuto(s)\n", m);
  printf("%d segundo(s)\n", s);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x37(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x39(%rbp),%r8
lea    -0x24(%rbp),%r9
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe72(%rip),%rdi
lea    -0x37(%rbp),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe62(%rip),%rdi
lea    -0x2c(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x30(%rbp),%rcx
lea    -0x39(%rbp),%r8
lea    -0x34(%rbp),%r9
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x28(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x18,%eax
sub    -0x1c(%rbp),%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x18,-0xc(%rbp)
jne    11e7 <main+0xa7>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11fa <main+0xba>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x30(%rbp),%edi
sub    -0x20(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x10(%rbp)
mov    -0x34(%rbp),%edi
sub    -0x24(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
lea    0xdf5(%rip),%rdi
call   1050 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xdf1(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xdee(%rip),%rdi
call   1050 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xded(%rip),%rdi
call   1050 <printf@plt>
lea    0xdf0(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x40,%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    0xebb(%rip),%r14
xor    %ebp,%ebp
lea    0x25(%rsp),%rbx
lea    0x20(%rsp),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xea1(%rip),%r15
lea    0x1c(%rsp),%rsi
lea    0x3(%rsp),%r12
lea    0x18(%rsp),%rcx
lea    0x2(%rsp),%r13
lea    0x14(%rsp),%r9
mov    %r15,%rdi
mov    %r12,%rdx
mov    %r13,%r8
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x10(%rsp),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r9
mov    %r15,%rdi
mov    %r12,%rdx
mov    %r13,%r8
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x10(%rsp),%esi
sub    0x20(%rsp),%esi
mov    0xc(%rsp),%ebx
sub    0x1c(%rsp),%ebx
add    $0x18,%ebx
cmp    $0x18,%ebx
cmove  %ebp,%ebx
cmp    $0x1,%ebx
adc    $0xffffffff,%esi
mov    0x8(%rsp),%eax
sub    0x18(%rsp),%eax
mov    %eax,%r14d
neg    %r14d
cmovs  %eax,%r14d
mov    0x4(%rsp),%eax
sub    0x14(%rsp),%eax
mov    %eax,%ebp
neg    %ebp
cmovs  %eax,%ebp
lea    0xe0f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe0e(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    0xe0c(%rip),%rdi
mov    %r14d,%esi
call   1040 <printf@plt>
lea    0xe0b(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
lea    0xe0c(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %d\00"
@.str.1 = [15 x i8] c"%d %c %d %c %d\00"
@.str.2 = [11 x i8] c"%d dia(s)\0A\00"
@.str.3 = [12 x i8] c"%d hora(s)\0A\00"
@.str.4 = [14 x i8] c"%d minuto(s)\0A\00"
@.str.5 = [15 x i8] c"%d segundo(s)\0A\00"
@.str.6 = [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
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [3 x i8]
%15 = alloca i8
%16 = alloca i8
store i32 0, i32* %1
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), [3 x i8]* %14, i32* %6)
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %7, i8* %15, i32* %8, i8* %16, i32* %9)
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), [3 x i8]* %14, i32* %10)
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %11, i8* %15, i32* %12, i8* %16, i32* %13)
%21 = load i32, i32* %10
%22 = load i32, i32* %6
%23 = sub nsw i32 %21, %22
store i32 %23, i32* %2
%24 = load i32, i32* %7
%25 = sub nsw i32 24, %24
%26 = load i32, i32* %11
%27 = add nsw i32 %25, %26
store i32 %27, i32* %3
%28 = load i32, i32* %3
%29 = icmp eq i32 %28, 24
br i1 %29, label %30, label %31
30: ; preds = %0
store i32 0, i32* %3
br label %31
31: ; preds = %30, %0
%32 = load i32, i32* %3
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load i32, i32* %2
%36 = sub nsw i32 %35, 1
store i32 %36, i32* %2
br label %37
37: ; preds = %34, %31
%38 = load i32, i32* %12
%39 = load i32, i32* %8
%40 = sub nsw i32 %38, %39
%41 = call i32 @abs(i32 %40)
store i32 %41, i32* %4
%42 = load i32, i32* %13
%43 = load i32, i32* %9
%44 = sub nsw i32 %42, %43
%45 = call i32 @abs(i32 %44)
store i32 %45, i32* %5
%46 = load i32, i32* %2
%47 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %46)
%48 = load i32, i32* %3
%49 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %48)
%50 = load i32, i32* %4
%51 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %50)
%52 = load i32, i32* %5
%53 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %52)
%54 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %d\00"
@.str.1 = [15 x i8] c"%d %c %d %c %d\00"
@.str.2 = [11 x i8] c"%d dia(s)\0A\00"
@.str.3 = [12 x i8] c"%d hora(s)\0A\00"
@.str.4 = [14 x i8] c"%d minuto(s)\0A\00"
@.str.5 = [15 x i8] c"%d segundo(s)\0A\00"
@.str.6 = [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
%8 = alloca i32
%9 = alloca [3 x i8]
%10 = alloca i8
%11 = alloca i8
%12 = bitcast i32* %1 to i8*
%13 = bitcast i32* %2 to i8*
%14 = bitcast i32* %3 to i8*
%15 = bitcast i32* %4 to i8*
%16 = bitcast i32* %5 to i8*
%17 = bitcast i32* %6 to i8*
%18 = bitcast i32* %7 to i8*
%19 = bitcast i32* %8 to i8*
%20 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 0
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), [3 x i8]* %9, i32* %1)
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %2, i8* %10, i32* %3, i8* %11, i32* %4)
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), [3 x i8]* %9, i32* %5)
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %6, i8* %10, i32* %7, i8* %11, i32* %8)
%25 = load i32, i32* %5
%26 = load i32, i32* %1
%27 = sub i32 %25, %26
%28 = load i32, i32* %2
%29 = sub nsw i32 24, %28
%30 = load i32, i32* %6
%31 = add nsw i32 %29, %30
%32 = icmp eq i32 %31, 24
%33 = select i1 %32, i32 0, i32 %31
%34 = icmp ne i32 %33, 0
%35 = sext i1 %34 to i32
%36 = add nsw i32 %27, %35
%37 = load i32, i32* %7
%38 = load i32, i32* %3
%39 = sub nsw i32 %37, %38
%40 = call i32 @llvm.abs.i32(i32 %39, i1 true)
%41 = load i32, i32* %8
%42 = load i32, i32* %4
%43 = sub nsw i32 %41, %42
%44 = call i32 @llvm.abs.i32(i32 %43, i1 true)
%45 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %36)
%46 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %33)
%47 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %40)
%48 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %44)
%49 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}