#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, int);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int d1, d2, h1, h2, m1, m2, s1, s2, t1, t2, T;
  char *dia1, *dia2;
  scanf("%s %d", &dia1, &d1);
  scanf("%d : %d : %d", &h1, &m1, &s1);
  scanf("%s %d", &dia2, &d2);
  scanf("%d : %d : %d", &h2, &m2, &s2);
  t1 = (d1 * 86400) + (h1 * 3600) + (m1 * 60) + s1;
  t2 = (d2 * 86400) + (h2 * 3600) + (m2 * 60) + s2;
  T = t2 - t1;
  d1 = T / 86400;
  h1 = (T % 86400) / 3600;
  m1 = (((T % 86400) % 3600) / 60);
  s1 = (((T % 86400) % 3600) % 60);
  printf("%d dia(s)\n%d hora(s)\n%d minuto(s)\n%d segundo(s)\n", d1, h1, m1,
         s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x40(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x24(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
imul   $0x15180,-0x8(%rbp),%eax
imul   $0xe10,-0x10(%rbp),%ecx
add    %ecx,%eax
imul   $0x3c,-0x18(%rbp),%ecx
add    %ecx,%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x28(%rbp)
imul   $0x15180,-0xc(%rbp),%eax
imul   $0xe10,-0x14(%rbp),%ecx
add    %ecx,%eax
imul   $0x3c,-0x1c(%rbp),%ecx
add    %ecx,%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
sub    -0x28(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    $0x15180,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x30(%rbp),%eax
mov    $0x15180,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x30(%rbp),%eax
mov    $0x15180,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x30(%rbp),%eax
mov    $0x15180,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x20(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xdc5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xed2(%rip),%r14
lea    0x30(%rsp),%rsi
lea    0x14(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xebd(%rip),%rbx
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x28(%rsp),%rsi
lea    0x24(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x20(%rsp),%rsi
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x24(%rsp),%eax
mov    0x20(%rsp),%ecx
mov    0x1c(%rsp),%edx
sub    0xc(%rsp),%edx
sub    0x10(%rsp),%ecx
sub    0x14(%rsp),%eax
imul   $0x3c,%edx,%edx
imul   $0x15180,%eax,%eax
sub    0x8(%rsp),%eax
imul   $0xe10,%ecx,%ecx
add    0x18(%rsp),%eax
add    %ecx,%eax
add    %edx,%eax
cltq
imul   $0xffffffffc22e4507,%rax,%rsi
shr    $0x20,%rsi
add    %eax,%esi
mov    %esi,%ecx
shr    $0x1f,%ecx
sar    $0x10,%esi
add    %ecx,%esi
mov    %esi,0x14(%rsp)
imul   $0x15180,%esi,%ecx
sub    %ecx,%eax
cltq
imul   $0xffffffff91a2b3c5,%rax,%rdx
shr    $0x20,%rdx
add    %eax,%edx
mov    %edx,%ecx
shr    $0x1f,%ecx
sar    $0xb,%edx
add    %ecx,%edx
mov    %edx,0x10(%rsp)
imul   $0xe10,%edx,%ecx
sub    %ecx,%eax
movswl %ax,%ecx
imul   $0xffff8889,%ecx,%ecx
shr    $0x10,%ecx
add    %eax,%ecx
movzwl %cx,%ecx
movswl %cx,%edi
shr    $0xf,%ecx
sar    $0x5,%edi
add    %ecx,%edi
movswl %di,%ecx
mov    %ecx,0xc(%rsp)
imul   $0x3c,%edi,%edi
sub    %edi,%eax
movswl %ax,%r8d
mov    %r8d,0x8(%rsp)
lea    0xdcf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

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

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