#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 *);
int /*<<< orphan*/ system(char *);
void main() {
  int day_1, month_1, year_1;
  int day_2, month_2, year_2;
  printf("Enter date_1:");
  scanf("%d%d%d", &day_1, &month_1, &year_1);
  printf("Enter date_2:");
  scanf("%d%d%d", &day_2, &month_2, &year_2);
  printf("The difference is:\n");
  printf("%d-%d-%d\n", day_1 - day_2, month_1 - month_2, year_1 - year_2);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1050 <scanf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9b(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1050 <scanf@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%esi
sub    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
sub    -0x14(%rbp),%edx
mov    -0xc(%rbp),%ecx
sub    -0x18(%rbp),%ecx
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe88(%rip),%rdi
call   1030 <system@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb4(%rip),%rbx
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%rcx
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
mov    0x1c(%rsp),%esi
sub    0x10(%rsp),%esi
mov    0x18(%rsp),%edx
sub    0xc(%rsp),%edx
mov    0x14(%rsp),%ecx
sub    0x8(%rsp),%ecx
lea    0xe62(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe5e(%rip),%rdi
call   1040 <system@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Enter date_1:\00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [14 x i8] c"Enter date_2:\00"
@.str.3 = [20 x i8] c"The difference is:\0A\00"
@.str.4 = [10 x i8] c"%d-%d-%d\0A\00"
@.str.5 = [6 x i8] c"pause\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
%15 = load i32, i32* %2
%16 = load i32, i32* %5
%17 = sub nsw i32 %15, %16
%18 = load i32, i32* %3
%19 = load i32, i32* %6
%20 = sub nsw i32 %18, %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %14, i32 %17, i32 %20)
%22 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Enter date_1:\00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [14 x i8] c"Enter date_2:\00"
@.str.4 = [10 x i8] c"%d-%d-%d\0A\00"
@.str.5 = [6 x i8] c"pause\00"
@str = [19 x i8] c"The difference is:\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 ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%18 = load i32, i32* %1
%19 = load i32, i32* %4
%20 = sub nsw i32 %18, %19
%21 = load i32, i32* %2
%22 = load i32, i32* %5
%23 = sub nsw i32 %21, %22
%24 = load i32, i32* %3
%25 = load i32, i32* %6
%26 = sub nsw i32 %24, %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %20, i32 %23, i32 %26)
%28 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret void
}