#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*/ Date(int *, int);
scalar_t__ Tot(int *);
int abs(scalar_t__);
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, int, int, int);
int main() {
  int data1[3], data2[3], i, delta, deltaAnni, deltaMesi, deltaDay;
  i = 1;
  Date(data1, i);
  i++;
  Date(data2, i);
  delta = abs(Tot(data1) - Tot(data2));
  deltaAnni = delta / 360;
  deltaMesi = (delta % 360) / 30;
  deltaDay = delta - (deltaMesi + deltaAnni * 12) * 30;
  printf("Tra il %d/%d/%d e il %d/%d/%d intercorrono: %d giorni, %d mesi, %d "
         "anni.",
         data1[2], data1[1], data1[0], data2[2], data2[1], data2[0], deltaDay,
         deltaMesi, deltaAnni);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x58,%rsp
movl   $0x1,-0x24(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <Date@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <Date@plt>
lea    -0x14(%rbp),%rdi
call   1060 <Tot@plt>
mov    %rax,-0x40(%rbp)
lea    -0x20(%rbp),%rdi
call   1060 <Tot@plt>
mov    -0x40(%rbp),%rdi
sub    %rax,%rdi
call   1030 <abs@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    $0x168,%ecx
cltd
idiv   %ecx
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
mov    $0x168,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x30(%rbp),%ecx
imul   $0xc,-0x2c(%rbp),%edx
add    %edx,%ecx
imul   $0x1e,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%ebx
mov    -0x34(%rbp),%r11d
mov    -0x30(%rbp),%r10d
mov    -0x2c(%rbp),%eax
lea    0xe0a(%rip),%rdi
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0x14(%rsp),%r14
mov    %r14,%rdi
mov    $0x1,%esi
call   1050 <Date@plt>
lea    0x8(%rsp),%r15
mov    %r15,%rdi
mov    $0x2,%esi
call   1050 <Date@plt>
mov    %r14,%rdi
call   1060 <Tot@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1060 <Tot@plt>
sub    %rax,%rbx
mov    %rbx,%rdi
call   1030 <abs@plt>
movslq %eax,%rcx
imul   $0xffffffffb60b60b7,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x8,%eax
add    %edx,%eax
imul   $0x168,%eax,%edx
mov    %ecx,%esi
sub    %edx,%esi
movswl %si,%edx
imul   $0xffff8889,%edx,%edx
shr    $0x10,%edx
add    %esi,%edx
movzwl %dx,%edx
movswl %dx,%esi
shr    $0xf,%edx
sar    $0x4,%esi
add    %edx,%esi
movswl %si,%r10d
lea    (%rax,%rax,2),%edx
lea    (%r10,%rdx,4),%edx
imul   $0xffffffe2,%edx,%ebx
add    %ecx,%ebx
mov    0x1c(%rsp),%esi
mov    0x14(%rsp),%ecx
mov    0x18(%rsp),%edx
mov    0x10(%rsp),%r8d
mov    0x8(%rsp),%r11d
mov    0xc(%rsp),%r9d
lea    0xe03(%rip),%rdi
push   %rax
push   %r10
push   %rbx
push   %r11
call   1040 <printf@plt>
add    $0x20,%rsp
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [73 x i8] c"Tra il %d/%d/%d e il %d/%d/%d intercorrono: %d giorni, %d mesi, %d anni.\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 1, i32* %3
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @Date(i32* %8, i32 %9)
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%14 = load i32, i32* %3
%15 = call i32 @Date(i32* %13, i32 %14)
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%17 = call i64 @Tot(i32* %16)
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%19 = call i64 @Tot(i32* %18)
%20 = sub nsw i64 %17, %19
%21 = call i32 @abs(i64 %20)
store i32 %21, i32* %4
%22 = load i32, i32* %4
%23 = sdiv i32 %22, 360
store i32 %23, i32* %5
%24 = load i32, i32* %4
%25 = srem i32 %24, 360
%26 = sdiv i32 %25, 30
store i32 %26, i32* %6
%27 = load i32, i32* %4
%28 = load i32, i32* %6
%29 = load i32, i32* %5
%30 = mul nsw i32 %29, 12
%31 = add nsw i32 %28, %30
%32 = mul nsw i32 %31, 30
%33 = sub nsw i32 %27, %32
store i32 %33, i32* %7
%34 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%35 = load i32, i32* %34
%36 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%37 = load i32, i32* %36
%38 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%39 = load i32, i32* %38
%40 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%41 = load i32, i32* %40
%42 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%43 = load i32, i32* %42
%44 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%45 = load i32, i32* %44
%46 = load i32, i32* %7
%47 = load i32, i32* %6
%48 = load i32, i32* %5
%49 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i32 %35, i32 %37, i32 %39, i32 %41, i32 %43, i32 %45, i32 %46, i32 %47, i32 %48)
ret i32 0
}

LLVM IR (-O2):
@.str = [73 x i8] c"Tra il %d/%d/%d e il %d/%d/%d intercorrono: %d giorni, %d mesi, %d anni.\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = call i32 @Date(i32* %5, i32 1)
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%8 = call i32 @Date(i32* %7, i32 2)
%9 = call i64 @Tot(i32* %5)
%10 = call i64 @Tot(i32* %7)
%11 = sub nsw i64 %9, %10
%12 = call i32 @abs(i64 %11)
%13 = sdiv i32 %12, 360
%14 = srem i32 %12, 360
%15 = trunc i32 %14 to i16
%16 = sdiv i16 %15, 30
%17 = sext i16 %16 to i32
%18 = mul nsw i32 %13, 12
%19 = add nsw i32 %18, %17
%20 = mul i32 %19, -30
%21 = add i32 %20, %12
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%23 = load i32, i32* %22
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%25 = load i32, i32* %24
%26 = load i32, i32* %5
%27 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%28 = load i32, i32* %27
%29 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%30 = load i32, i32* %29
%31 = load i32, i32* %7
%32 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %25, i32 %26, i32 %28, i32 %30, i32 %31, i32 %21, i32 %17, i32 %13)
ret i32 0
}