#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 main(void) {
  char dia_i[5], dia_f[5], p[2], p2[2];
  int DIA_I, HORA_I, MIN_I, SEG_I, DIA_F, HORA_F, MIN_F, SEG_F, DIA_T, HORA_T,
      MIN_T, SEG_T, TOTAL, D, H, M, S;
  scanf("%s%d", dia_i, &DIA_I);
  scanf("%d%s%d%s%d", &HORA_I, p, &MIN_I, p2, &SEG_I);
  scanf("%s%d", dia_f, &DIA_F);
  scanf("%d%s%d%s%d", &HORA_F, p, &MIN_F, p2, &SEG_F);
  DIA_T = (DIA_F - DIA_I - 1) * 86400;
  HORA_T = (24 - 1 - (HORA_I + HORA_F)) * 3600;
  MIN_T = (60 - MIN_I - 1 + MIN_F) * 60;
  SEG_T = 60 - SEG_I + SEG_F;
  TOTAL = DIA_T + HORA_T + MIN_T + SEG_T;
  D = TOTAL / 86400;
  printf("%d dia(s)\n", D);
  D = TOTAL % 86400;
  H = D / 3600;
  printf("%d hora(s)\n", H);
  H = D % 3600;
  M = H / 60;
  printf("%d minuto(s)\n", M);
  S = H % 60;
  printf("%d segundo(s)\n", S);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x9(%rbp),%rsi
lea    0xecc(%rip),%rdi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0x10(%rbp),%rdx
lea    -0x12(%rbp),%r8
lea    0xeac(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r9
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0xe(%rbp),%rsi
lea    0xe94(%rip),%rdi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0x10(%rbp),%rdx
lea    -0x12(%rbp),%r8
lea    0xe74(%rip),%rdi
lea    -0x2c(%rbp),%rsi
lea    -0x30(%rbp),%rcx
lea    -0x34(%rbp),%r9
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x28(%rbp),%eax
sub    -0x18(%rbp),%eax
sub    $0x1,%eax
imul   $0x15180,%eax,%eax
mov    %eax,-0x38(%rbp)
mov    -0x1c(%rbp),%ecx
add    -0x2c(%rbp),%ecx
mov    $0x17,%eax
sub    %ecx,%eax
imul   $0xe10,%eax,%eax
mov    %eax,-0x3c(%rbp)
mov    $0x3c,%eax
sub    -0x20(%rbp),%eax
sub    $0x1,%eax
add    -0x30(%rbp),%eax
imul   $0x3c,%eax,%eax
mov    %eax,-0x40(%rbp)
mov    $0x3c,%eax
sub    -0x24(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x38(%rbp),%eax
add    -0x3c(%rbp),%eax
add    -0x40(%rbp),%eax
add    -0x44(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    $0x15180,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%esi
lea    0xdfb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%eax
mov    $0x15180,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%esi
lea    0xddb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%esi
lea    0xdbc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x50(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x58(%rbp)
mov    -0x58(%rbp),%esi
lea    0xdad(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xed4(%rip),%r14
lea    0x33(%rsp),%rsi
lea    0x24(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeb3(%rip),%rbx
lea    0x20(%rsp),%rsi
lea    0x2c(%rsp),%r15
lea    0x1c(%rsp),%rcx
lea    0x2a(%rsp),%r12
lea    0x18(%rsp),%r9
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r12,%r8
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x2e(%rsp),%rsi
lea    0x14(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r9
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r12,%r8
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x24(%rsp),%eax
not    %eax
add    0x14(%rsp),%eax
imul   $0x15180,%eax,%eax
mov    0x20(%rsp),%ecx
add    0x10(%rsp),%ecx
mov    $0x17,%edx
sub    %ecx,%edx
imul   $0xe10,%edx,%ecx
mov    0xc(%rsp),%edx
sub    0x1c(%rsp),%edx
add    %eax,%ecx
imul   $0x3c,%edx,%eax
sub    0x18(%rsp),%ecx
add    %eax,%ecx
mov    0x8(%rsp),%eax
lea    (%rcx,%rax,1),%edx
add    %ecx,%eax
add    $0xe10,%eax
lea    0xe15(%rip),%rdi
movslq %eax,%r14
imul   $0xffffffffc22e4507,%r14,%rax
shr    $0x20,%rax
lea    (%rax,%rdx,1),%ebx
add    $0xe10,%ebx
mov    %ebx,%eax
shr    $0x1f,%eax
sar    $0x10,%ebx
add    %eax,%ebx
mov    %ebx,%esi
call   1030 <printf@plt>
imul   $0x15180,%ebx,%eax
sub    %eax,%r14d
lea    0xde8(%rip),%rdi
movslq %r14d,%r14
imul   $0xffffffff91a2b3c5,%r14,%rbx
shr    $0x20,%rbx
add    %r14d,%ebx
mov    %ebx,%eax
shr    $0x1f,%eax
sar    $0xb,%ebx
add    %eax,%ebx
mov    %ebx,%esi
call   1030 <printf@plt>
imul   $0xe10,%ebx,%eax
sub    %eax,%r14d
movswl %r14w,%eax
imul   $0xffff8889,%eax,%eax
shr    $0x10,%eax
add    %r14d,%eax
movzwl %ax,%eax
movswl %ax,%ebx
shr    $0xf,%eax
sar    $0x5,%ebx
add    %eax,%ebx
movswl %bx,%esi
lea    0xda1(%rip),%rdi
call   1030 <printf@plt>
imul   $0x3c,%ebx,%eax
sub    %eax,%r14d
movswl %r14w,%esi
lea    0xd99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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