#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 */
struct tm {
  int tm_mon;
  int tm_mday;
  int tm_year;
};

/* Variables and functions */
int Julian(char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
int /*<<< orphan*/ time(long *);
unsigned TodaysDate() {
  struct tm *st, *localtime();
  long prsnt_time;
  char tim[10];
  time(&prsnt_time);
  st = localtime(&prsnt_time);
  sprintf(tim, "%02d-%02d-%02d", st->tm_mon + 1, st->tm_mday, st->tm_year);
  return (Julian(tim));
}


x86 assembly (clang, -O0):
<TodaysDate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
call   1040 <time@plt>
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <localtime@plt>
mov    %rax,-0x8(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%r8d
lea    0xe7d(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x1a(%rbp),%rdi
call   1050 <Julian@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TodaysDate>:
push   %rbx
sub    $0x20,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <localtime@plt>
mov    (%rax),%edx
mov    0x4(%rax),%ecx
add    $0x1,%edx
mov    0x8(%rax),%r8d
lea    0xe91(%rip),%rsi
lea    0x16(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <Julian@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32 }
@.str = [15 x i8] c"%02d-%02d-%02d\00"
define i32 @TodaysDate() {
%1 = alloca %struct.tm*
%2 = alloca i64
%3 = alloca [10 x i8]
%4 = call i32 @time(i64* %2)
%5 = call %struct.tm* (i64*, ...) bitcast (%struct.tm* (...)* @localtime to %struct.tm* (i64*, ...)*)(i64* %2)
store %struct.tm* %5, %struct.tm** %1
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = load %struct.tm*, %struct.tm** %1
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
%11 = load %struct.tm*, %struct.tm** %1
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 1
%13 = load i32, i32* %12
%14 = load %struct.tm*, %struct.tm** %1
%15 = getelementptr inbounds %struct.tm, %struct.tm* %14, i32 0, i32 2
%16 = load i32, i32* %15
%17 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %13, i32 %16)
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%19 = call i32 @Julian(i8* %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32 }
@.str = [15 x i8] c"%02d-%02d-%02d\00"
define i32 @TodaysDate() {
%1 = alloca i64
%2 = alloca [10 x i8]
%3 = bitcast i64* %1 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @time(i64* %1)
%6 = call %struct.tm* (i64*, ...) bitcast (%struct.tm* (...)* @localtime to %struct.tm* (i64*, ...)*)(i64* %1)
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
%10 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.tm, %struct.tm* %6, i64 0, i32 2
%13 = load i32, i32* %12
%14 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11, i32 %13)
%15 = call i32 @Julian(i8* %4)
ret i32 %15
}