#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 /*<<< orphan*/ scanf(char *, int *, ...);
int main(void) {
  int diaInicial, horaInicial, minutoInicial, segundoInicial;
  int diaFinal, horaFinal, minutoFinal, segundoFinal;
  int diaDelta, horaDelta, minutoDelta, segundoDelta;
  scanf("Dia %d\n", &diaInicial);
  scanf("%d : %d : %d\n", &horaInicial, &minutoInicial, &segundoInicial);
  scanf("Dia %d\n", &diaFinal);
  scanf("%d : %d : %d\n", &horaFinal, &minutoFinal, &segundoFinal);
  if (segundoFinal >= segundoInicial) {
    segundoDelta = segundoFinal - segundoInicial;
  } else {
    segundoDelta = segundoFinal - segundoInicial + 60;
    minutoFinal--;
  }
  if (minutoFinal >= minutoInicial) {
    minutoDelta = minutoFinal - minutoInicial;
  } else {
    minutoDelta = minutoFinal - minutoInicial + 60;
    horaFinal--;
  }
  if (horaFinal >= horaInicial) {
    horaDelta = horaFinal - horaInicial;
  } else {
    horaDelta = horaFinal - horaInicial + 24;
    diaFinal--;
  }
  diaDelta = diaFinal - diaInicial;
  printf("%d dia(s)\n", diaDelta);
  printf("%d hora(s)\n", horaDelta);
  printf("%d minuto(s)\n", minutoDelta);
  printf("%d segundo(s)\n", segundoDelta);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec0(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9e(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe94(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     11a1 <main+0x81>
mov    -0x24(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    11b6 <main+0x96>
mov    -0x24(%rbp),%eax
sub    -0x14(%rbp),%eax
add    $0x3c,%eax
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11d0 <main+0xb0>
mov    -0x20(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    11e5 <main+0xc5>
mov    -0x20(%rbp),%eax
sub    -0x10(%rbp),%eax
add    $0x3c,%eax
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     11ff <main+0xdf>
mov    -0x1c(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1214 <main+0xf4>
mov    -0x1c(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x18,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xdef(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2c(%rbp),%esi
lea    0xdeb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xde8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xde7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xed1(%rip),%rbx
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec3(%rip),%rbp
lea    0x18(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
lea    0xc(%rsp),%rcx
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%r14d
mov    0x10(%rsp),%eax
cmp    %eax,%r14d
jge    11a1 <main+0x81>
add    $0x3c,%r14d
mov    (%rsp),%ebp
add    $0xffffffff,%ebp
mov    %ebp,(%rsp)
jmp    11a4 <main+0x84>
mov    (%rsp),%ebp
mov    0x14(%rsp),%ecx
cmp    %ecx,%ebp
jge    11bc <main+0x9c>
add    $0x3c,%ebp
mov    0x4(%rsp),%ebx
add    $0xffffffff,%ebx
mov    %ebx,0x4(%rsp)
jmp    11c0 <main+0xa0>
mov    0x4(%rsp),%ebx
mov    0x18(%rsp),%edx
cmp    %edx,%ebx
jge    11d8 <main+0xb8>
add    $0x18,%ebx
mov    0x8(%rsp),%esi
add    $0xffffffff,%esi
mov    %esi,0x8(%rsp)
jmp    11dc <main+0xbc>
mov    0x8(%rsp),%esi
sub    %eax,%r14d
sub    %ecx,%ebp
sub    %edx,%ebx
sub    0x1c(%rsp),%esi
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
lea    0xe27(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xe25(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xe25(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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