#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 /*<<< orphan*/ yrCalc(long *, int *, int *, int *);
int main() {
  long totalDays;
  totalDays = 365000;
  printf("\n%d totalDays start", totalDays);
  int year, yearDays = 365, month, monthDays = 30, day, days = 1;
  printf("\nEnter current year --> ");
  scanf("%d", &year);
  printf("\nEnter current month (1-12)--> ");
  scanf("%d", &month);
  printf("\nEnter today's day number (1-30)--> ");
  scanf("%d", &day);
  printf("\n%d totalDays 2", totalDays);
  yrCalc(&totalDays, &year, &month, &day);
  printf("\nTotal days from 1/1/1900 to today's date is %d.", totalDays);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x591c8,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x16d,-0x18(%rbp)
movl   $0x1e,-0x20(%rbp)
movl   $0x1,-0x28(%rbp)
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6e(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x24(%rbp),%rcx
call   1040 <yrCalc@plt>
mov    -0x10(%rbp),%rsi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movq   $0x591c8,(%rsp)
lea    0xeb6(%rip),%rdi
mov    $0x591c8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec2(%rip),%rbx
lea    0x14(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x591c8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1040 <yrCalc@plt>
mov    (%rsp),%rsi
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0A%d totalDays start\00"
@.str.1 = [25 x i8] c"\0AEnter current year --> \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [32 x i8] c"\0AEnter current month (1-12)--> \00"
@.str.4 = [37 x i8] c"\0AEnter today's day number (1-30)--> \00"
@.str.5 = [16 x i8] c"\0A%d totalDays 2\00"
@.str.6 = [49 x i8] c"\0ATotal days from 1/1/1900 to today's date is %d.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i64 365000, i64* %2
%9 = load i64, i64* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %9)
store i32 365, i32* %4
store i32 30, i32* %6
store i32 1, i32* %8
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%17 = load i64, i64* %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i64 %17)
%19 = call i32 @yrCalc(i64* %2, i32* %3, i32* %5, i32* %7)
%20 = load i64, i64* %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i64 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0A%d totalDays start\00"
@.str.1 = [25 x i8] c"\0AEnter current year --> \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [32 x i8] c"\0AEnter current month (1-12)--> \00"
@.str.4 = [37 x i8] c"\0AEnter today's day number (1-30)--> \00"
@.str.5 = [16 x i8] c"\0A%d totalDays 2\00"
@.str.6 = [49 x i8] c"\0ATotal days from 1/1/1900 to today's date is %d.\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i64* %1 to i8*
store i64 365000, i64* %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 365000)
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i64 365000)
%17 = call i32 @yrCalc(i64* %1, i32* %2, i32* %3, i32* %4)
%18 = load i64, i64* %1
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0), i64 %18)
ret i32 0
}