#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 start(void) {
  int date, month, year;
  int date1, month1, year1;
  int ans_date, ans_month, ans_year;
  printf("Enter the Current Day,Month,Year separate by space.\n");
  scanf("%d%d%d", &date, &month, &year);
  printf("Enter your birth Day,Month,Year separate by space.\n");
  scanf("%d%d%d", &date1, &month1, &year1);
  ans_date = date - date1;
  ans_date += 1;
  ans_month = month - month1;
  ans_year = year - year1;
  while (ans_month < 0) {
    ans_month = 12 + ans_month;
    ans_year -= 1;
  }
  while (ans_date < 0) {
    ans_date = 30 + ans_date;
    ans_month -= 1;
  }
  printf("\nYou are %d years %d months %d days old\n", ans_year, ans_month,
         ans_date);
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    11b9 <start+0x99>
mov    -0x20(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1198 <start+0x78>
jmp    11be <start+0x9e>
cmpl   $0x0,-0x1c(%rbp)
jge    11df <start+0xbf>
mov    -0x1c(%rbp),%eax
add    $0x1e,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11be <start+0x9e>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
push   %rbx
sub    $0x20,%rsp
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rbx
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%rcx
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x1c(%rsp),%r9d
mov    0x10(%rsp),%r8d
mov    %r9d,%ecx
sub    %r8d,%ecx
add    $0x1,%ecx
mov    0x18(%rsp),%edi
mov    0xc(%rsp),%r10d
mov    0x14(%rsp),%esi
mov    0x8(%rsp),%r11d
mov    %edi,%edx
sub    %r10d,%edx
js     120b <start+0xdb>
sub    %r11d,%esi
test   %ecx,%ecx
jns    11f7 <start+0xc7>
cmp    $0xffffffe3,%ecx
mov    $0xffffffe2,%eax
cmovge %ecx,%eax
add    %r8d,%eax
mov    %r9d,%ecx
not    %ecx
xor    %edi,%edi
add    %eax,%ecx
setne  %dil
sub    %edi,%ecx
mov    $0x88888889,%eax
imul   %rcx,%rax
shr    $0x24,%rax
add    %edi,%eax
mov    %eax,%ecx
shl    $0x5,%ecx
sub    %eax,%ecx
sub    %eax,%ecx
add    %r9d,%ecx
sub    %r8d,%ecx
add    $0x1f,%ecx
not    %eax
add    %eax,%edx
lea    0xe09(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret
cmp    $0xfffffff5,%edx
mov    $0xfffffff4,%ebx
cmovge %edx,%ebx
add    %r10d,%ebx
xor    %edx,%edx
sub    %edi,%ebx
setne  %dl
sub    %edx,%ebx
mov    $0xaaaaaaab,%eax
imul   %rbx,%rax
shr    $0x23,%rax
add    %edx,%eax
lea    (%rax,%rax,2),%edx
lea    (%rdi,%rdx,4),%edx
not    %r11d
add    %r11d,%esi
sub    %r10d,%edx
add    $0xc,%edx
sub    %eax,%esi
test   %ecx,%ecx
jns    11f7 <start+0xc7>
jmp    11b5 <start+0x85>

LLVM IR (-O0):
@.str = [53 x i8] c"Enter the Current Day,Month,Year separate by space.\0A\00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [52 x i8] c"Enter your birth Day,Month,Year separate by space.\0A\00"
@.str.3 = [41 x i8] c"\0AYou are %d years %d months %d days old\0A\00"
define void @start() {
%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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%14 = load i32, i32* %1
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
store i32 %18, i32* %7
%19 = load i32, i32* %2
%20 = load i32, i32* %5
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %8
%22 = load i32, i32* %3
%23 = load i32, i32* %6
%24 = sub nsw i32 %22, %23
store i32 %24, i32* %9
br label %25
25: ; preds = %28, %0
%26 = load i32, i32* %8
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = load i32, i32* %8
%30 = add nsw i32 12, %29
store i32 %30, i32* %8
%31 = load i32, i32* %9
%32 = sub nsw i32 %31, 1
store i32 %32, i32* %9
br label %25
33: ; preds = %25
br label %34
34: ; preds = %37, %33
%35 = load i32, i32* %7
%36 = icmp slt i32 %35, 0
br i1 %36, label %37, label %42
37: ; preds = %34
%38 = load i32, i32* %7
%39 = add nsw i32 30, %38
store i32 %39, i32* %7
%40 = load i32, i32* %8
%41 = sub nsw i32 %40, 1
store i32 %41, i32* %8
br label %34
42: ; preds = %34
%43 = load i32, i32* %9
%44 = load i32, i32* %8
%45 = load i32, i32* %7
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %43, i32 %44, i32 %45)
ret void
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.3 = [41 x i8] c"\0AYou are %d years %d months %d days old\0A\00"
@str = [52 x i8] c"Enter the Current Day,Month,Year separate by space.\00"
@str.4 = [51 x i8] c"Enter your birth Day,Month,Year separate by space.\00"
define void @start() {
%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 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 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 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.4, 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 = load i32, i32* %1
%18 = load i32, i32* %4
%19 = add i32 %17, 1
%20 = sub i32 %19, %18
%21 = load i32, i32* %2
%22 = load i32, i32* %5
%23 = sub i32 %21, %22
%24 = load i32, i32* %3
%25 = load i32, i32* %6
%26 = sub nsw i32 %24, %25
%27 = icmp slt i32 %23, 0
br i1 %27, label %28, label %44
28: ; preds = %0
%29 = call i32 @llvm.smax.i32(i32 %23, i32 -12)
%30 = add i32 %22, %29
%31 = sub i32 %30, %21
%32 = icmp ne i32 %31, 0
%33 = zext i1 %32 to i32
%34 = sub i32 %31, %33
%35 = udiv i32 %34, 12
%36 = add nuw nsw i32 %35, %33
%37 = mul i32 %36, 12
%38 = add i32 %21, %37
%39 = add i32 %38, 12
%40 = xor i32 %25, -1
%41 = add i32 %24, %40
%42 = sub i32 %39, %22
%43 = sub i32 %41, %36
br label %44
44: ; preds = %28, %0
%45 = phi i32 [ %23, %0 ], [ %42, %28 ]
%46 = phi i32 [ %26, %0 ], [ %43, %28 ]
%47 = icmp slt i32 %20, 0
br i1 %47, label %48, label %64
48: ; preds = %44
%49 = call i32 @llvm.smax.i32(i32 %20, i32 -30)
%50 = add i32 %18, %49
%51 = xor i32 %17, -1
%52 = add i32 %50, %51
%53 = icmp ne i32 %52, 0
%54 = zext i1 %53 to i32
%55 = sub i32 %52, %54
%56 = udiv i32 %55, 30
%57 = add nuw nsw i32 %56, %54
%58 = mul i32 %57, 30
%59 = add i32 %17, %58
%60 = add i32 %59, 31
%61 = sub i32 %60, %18
%62 = xor i32 %57, -1
%63 = add i32 %45, %62
br label %64
64: ; preds = %48, %44
%65 = phi i32 [ %20, %44 ], [ %61, %48 ]
%66 = phi i32 [ %45, %44 ], [ %63, %48 ]
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i32 %46, i32 %66, i32 %65)
ret void
}