#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 getTimeInSeconds(int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *, int *, int *);
int main(int args, char *argv[]) {
  int beginTime[3], endTime[3];
  scanf("%d:%d:%d %d:%d:%d", &beginTime[0], &beginTime[1], &beginTime[2],
        &endTime[0], &endTime[1], &endTime[2]);
  int btInSeconds = getTimeInSeconds(beginTime);
  int edInSeconds = getTimeInSeconds(endTime);
  int duration = edInSeconds - btInSeconds;
  if (duration < 0)
    duration += 86400;
  printf("%d", duration);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1c(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
add    $0x4,%rdx
lea    -0x1c(%rbp),%rcx
add    $0x8,%rcx
lea    -0x28(%rbp),%r8
lea    -0x28(%rbp),%r9
add    $0x4,%r9
lea    -0x28(%rbp),%rax
add    $0x8,%rax
lea    0xe8b(%rip),%rdi
mov    %rax,(%rsp)
call   1050 <scanf@plt>
lea    -0x1c(%rbp),%rdi
call   1030 <getTimeInSeconds@plt>
mov    %eax,-0x2c(%rbp)
lea    -0x28(%rbp),%rdi
call   1030 <getTimeInSeconds@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
sub    -0x2c(%rbp),%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    11b4 <main+0x84>
mov    -0x34(%rbp),%eax
add    $0x15180,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xe51(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0x20(%rsp),%rdx
lea    0x24(%rsp),%rcx
lea    0x14(%rsp),%r9
lea    0x18(%rsp),%rax
mov    %rax,(%rsp)
lea    0xeaa(%rip),%rdi
lea    0x1c(%rsp),%rbx
lea    0x10(%rsp),%r14
mov    %rbx,%rsi
mov    %r14,%r8
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <getTimeInSeconds@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1030 <getTimeInSeconds@plt>
sub    %ebx,%eax
lea    0x15180(%rax),%esi
test   %eax,%eax
cmovns %eax,%esi
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%d:%d:%d %d:%d:%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i32]
%7 = alloca [3 x i32]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 1
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 2
%17 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %11, i32* %12, i32* %13, i32* %14, i32* %15, i32* %16)
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%19 = call i32 @getTimeInSeconds(i32* %18)
store i32 %19, i32* %8
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%21 = call i32 @getTimeInSeconds(i32* %20)
store i32 %21, i32* %9
%22 = load i32, i32* %9
%23 = load i32, i32* %8
%24 = sub nsw i32 %22, %23
store i32 %24, i32* %10
%25 = load i32, i32* %10
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %2
%28 = load i32, i32* %10
%29 = add nsw i32 %28, 86400
store i32 %29, i32* %10
br label %30
30: ; preds = %27, %2
%31 = load i32, i32* %10
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"%d:%d:%d %d:%d:%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32]
%4 = alloca [3 x i32]
%5 = bitcast [3 x i32]* %3 to i8*
%6 = bitcast [3 x i32]* %4 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
%13 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %7, i32* %8, i32* %9, i32* %10, i32* %11, i32* %12)
%14 = call i32 @getTimeInSeconds(i32* %7)
%15 = call i32 @getTimeInSeconds(i32* %10)
%16 = sub nsw i32 %15, %14
%17 = icmp slt i32 %16, 0
%18 = add nsw i32 %16, 86400
%19 = select i1 %17, i32 %18, i32 %16
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %19)
ret i32 0
}