#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 /*<<< orphan*/ scanf(char *, int *, int *, int *);
void main() {
  int h1, m1, s1, h2, m2, s2;
  int diffsecs, diffmin, diffhrs;
  printf("Enter 1st Time");
  scanf("%d\t%d\t%d\n", &h1, &m1, &s1);
  printf("Enter 2nd Time");
  scanf("%d\t%d\t%d\n", &h2, &m2, &s2);
  int t1_in_secs = h1 * 3600 + m1 * 60 + s1;
  int t2_in_secs = h2 * 3600 + m2 * 60 + s2;
  diffsecs = t1_in_secs - t2_in_secs;
  diffmin = diffsecs / 60;
  printf("\n%d", diffmin);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <scanf@plt>
imul   $0xe10,-0x4(%rbp),%eax
imul   $0x3c,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
imul   $0xe10,-0x10(%rbp),%eax
imul   $0x3c,-0x14(%rbp),%ecx
add    %ecx,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
sub    -0x2c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rbx
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x1c(%rsp),%eax
mov    0x18(%rsp),%ecx
sub    0xc(%rsp),%ecx
mov    0x14(%rsp),%edx
imul   $0x3c,%ecx,%ecx
sub    0x10(%rsp),%eax
imul   $0xe10,%eax,%eax
sub    0x8(%rsp),%edx
add    %eax,%edx
add    %ecx,%edx
movslq %edx,%rsi
imul   $0xffffffff88888889,%rsi,%rax
shr    $0x20,%rax
add    %eax,%esi
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0x5,%esi
add    %eax,%esi
lea    0xe6c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter 1st Time\00"
@.str.1 = [10 x i8] c"%d\09%d\09%d\0A\00"
@.str.2 = [15 x i8] c"Enter 2nd Time\00"
@.str.3 = [4 x i8] c"\0A%d\00"
define void @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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%16 = load i32, i32* %1
%17 = mul nsw i32 %16, 3600
%18 = load i32, i32* %2
%19 = mul nsw i32 %18, 60
%20 = add nsw i32 %17, %19
%21 = load i32, i32* %3
%22 = add nsw i32 %20, %21
store i32 %22, i32* %10
%23 = load i32, i32* %4
%24 = mul nsw i32 %23, 3600
%25 = load i32, i32* %5
%26 = mul nsw i32 %25, 60
%27 = add nsw i32 %24, %26
%28 = load i32, i32* %6
%29 = add nsw i32 %27, %28
store i32 %29, i32* %11
%30 = load i32, i32* %10
%31 = load i32, i32* %11
%32 = sub nsw i32 %30, %31
store i32 %32, i32* %7
%33 = load i32, i32* %7
%34 = sdiv i32 %33, 60
store i32 %34, i32* %8
%35 = load i32, i32* %8
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %35)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Enter 1st Time\00"
@.str.1 = [10 x i8] c"%d\09%d\09%d\0A\00"
@.str.2 = [15 x i8] c"Enter 2nd Time\00"
@.str.3 = [4 x i8] c"\0A%d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = sub i32 %18, %21
%24 = mul i32 %23, 60
%25 = sub i32 %17, %20
%26 = mul i32 %25, 3600
%27 = sub i32 %19, %22
%28 = add i32 %27, %26
%29 = add i32 %28, %24
%30 = sdiv i32 %29, 60
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %30)
ret void
}