#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 */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_year;
  int tm_mon;
  int tm_mday;
  int tm_hour;
  int tm_min;
  int tm_sec;
};

/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, char *, char, char *, char, char *,
                            char, char *, char, char *, char, char *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_deletiondate() {
  time_t ttime;
  struct tm *timeinfo;
  time(&ttime);
  timeinfo = localtime(&ttime);
  char *deletiontime;
  char year[4];
  sprintf(year, "%d", timeinfo->tm_year + 1900);
  char month[2];
  sprintf(month, "%d", timeinfo->tm_mon + 1);
  char day[2];
  sprintf(day, "%d", timeinfo->tm_mday);
  char hour[2];
  sprintf(hour, "%d", timeinfo->tm_hour);
  char minutes[2];
  sprintf(minutes, "%d", timeinfo->tm_min);
  char seconds[2];
  sprintf(seconds, "%d", timeinfo->tm_sec);
  char tract = '-';
  char colon = ':';
  asprintf(&deletiontime, "%s%c%s%c%s%c%s%c%s%c%s", year, tract, month, tract,
           day, 'T', hour, colon, minutes, colon, seconds);
  return deletiontime;
}


x86 assembly (clang, -O0):
<get_deletiondate>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    -0x1c(%rbp),%rdi
call   1040 <time@plt>
lea    -0x1c(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x28(%rbp)
lea    -0x34(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%edx
add    $0x76c,%edx
lea    0xe86(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x36(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%edx
add    $0x1,%edx
lea    0xe6c(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%edx
lea    0xe55(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x3a(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    0xc(%rax),%edx
lea    0xe3e(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x3c(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    0x10(%rax),%edx
lea    0xe27(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x3e(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    0x14(%rax),%edx
lea    0xe10(%rip),%rsi
call   1060 <sprintf@plt>
movb   $0x2d,-0x3f(%rbp)
movb   $0x3a,-0x40(%rbp)
lea    -0x34(%rbp),%rdx
mov    -0x3f(%rbp),%cl
lea    -0x36(%rbp),%r8
mov    -0x3f(%rbp),%r9b
lea    -0x38(%rbp),%r15
lea    -0x3a(%rbp),%r14
mov    -0x40(%rbp),%bl
lea    -0x3c(%rbp),%r11
mov    -0x40(%rbp),%r10b
lea    -0x3e(%rbp),%rax
lea    -0x30(%rbp),%rdi
lea    0xdd5(%rip),%rsi
movsbl %cl,%ecx
movsbl %r9b,%r9d
mov    %r15,(%rsp)
movl   $0x54,0x8(%rsp)
mov    %r14,0x10(%rsp)
movsbl %bl,%ebx
mov    %ebx,0x18(%rsp)
mov    %r11,0x20(%rsp)
movsbl %r10b,%r10d
mov    %r10d,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1050 <asprintf@plt>
mov    -0x30(%rbp),%rax
add    $0x68,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_deletiondate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0x24(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    %rax,%rbx
mov    $0x76c,%edx
add    (%rax),%edx
lea    0xe8c(%rip),%r13
lea    0x14(%rsp),%rdi
mov    %r13,%rsi
call   1060 <sprintf@plt>
mov    0x4(%rbx),%edx
add    $0x1,%edx
lea    0x12(%rsp),%r12
mov    %r12,%rdi
mov    %r13,%rsi
call   1060 <sprintf@plt>
mov    0x8(%rbx),%edx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    %r13,%rsi
call   1060 <sprintf@plt>
mov    0xc(%rbx),%edx
lea    0xe(%rsp),%rbp
mov    %rbp,%rdi
mov    %r13,%rsi
call   1060 <sprintf@plt>
mov    0x10(%rbx),%edx
lea    0xc(%rsp),%r14
mov    %r14,%rdi
mov    %r13,%rsi
call   1060 <sprintf@plt>
mov    0x14(%rbx),%edx
lea    0xa(%rsp),%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
call   1060 <sprintf@plt>
sub    $0x8,%rsp
lea    0xe15(%rip),%rsi
lea    0x20(%rsp),%rdi
lea    0x1c(%rsp),%rdx
mov    $0x2d,%ecx
mov    %r12,%r8
mov    $0x2d,%r9d
push   %rbx
push   $0x3a
push   %r14
push   $0x3a
push   %rbp
push   $0x54
push   %r15
call   1050 <asprintf@plt>
add    $0x40,%rsp
mov    0x18(%rsp),%rax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [3 x i8] c"%d\00"
@.str.1 = [23 x i8] c"%s%c%s%c%s%c%s%c%s%c%s\00"
define i8* @get_deletiondate() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca i8*
%4 = alloca [4 x i8]
%5 = alloca [2 x i8]
%6 = alloca [2 x i8]
%7 = alloca [2 x i8]
%8 = alloca [2 x i8]
%9 = alloca [2 x i8]
%10 = alloca i8
%11 = alloca i8
%12 = call i32 @time(i32* %1)
%13 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %13, %struct.tm** %2
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%15 = load %struct.tm*, %struct.tm** %2
%16 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = add nsw i32 %17, 1900
%19 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%21 = load %struct.tm*, %struct.tm** %2
%22 = getelementptr inbounds %struct.tm, %struct.tm* %21, i32 0, i32 1
%23 = load i32, i32* %22
%24 = add nsw i32 %23, 1
%25 = call i32 @sprintf(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%27 = load %struct.tm*, %struct.tm** %2
%28 = getelementptr inbounds %struct.tm, %struct.tm* %27, i32 0, i32 2
%29 = load i32, i32* %28
%30 = call i32 @sprintf(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%32 = load %struct.tm*, %struct.tm** %2
%33 = getelementptr inbounds %struct.tm, %struct.tm* %32, i32 0, i32 3
%34 = load i32, i32* %33
%35 = call i32 @sprintf(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%37 = load %struct.tm*, %struct.tm** %2
%38 = getelementptr inbounds %struct.tm, %struct.tm* %37, i32 0, i32 4
%39 = load i32, i32* %38
%40 = call i32 @sprintf(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
%42 = load %struct.tm*, %struct.tm** %2
%43 = getelementptr inbounds %struct.tm, %struct.tm* %42, i32 0, i32 5
%44 = load i32, i32* %43
%45 = call i32 @sprintf(i8* %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %44)
store i8 45, i8* %10
store i8 58, i8* %11
%46 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%47 = load i8, i8* %10
%48 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%49 = load i8, i8* %10
%50 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%51 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%52 = load i8, i8* %11
%53 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%54 = load i8, i8* %11
%55 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
%56 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %46, i8 signext %47, i8* %48, i8 signext %49, i8* %50, i8 signext 84, i8* %51, i8 signext %52, i8* %53, i8 signext %54, i8* %55)
%57 = load i8*, i8** %3
ret i8* %57
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [3 x i8] c"%d\00"
@.str.1 = [23 x i8] c"%s%c%s%c%s%c%s%c%s%c%s\00"
define i8* @get_deletiondate() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [4 x i8]
%4 = alloca [2 x i8]
%5 = alloca [2 x i8]
%6 = alloca [2 x i8]
%7 = alloca [2 x i8]
%8 = alloca [2 x i8]
%9 = bitcast i32* %1 to i8*
%10 = call i32 @time(i32* %1)
%11 = call %struct.tm* @localtime(i32* %1)
%12 = bitcast i8** %2 to i8*
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds %struct.tm, %struct.tm* %11, i64 0, i32 0
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1900
%17 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%19 = getelementptr inbounds %struct.tm, %struct.tm* %11, i64 0, i32 1
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 1
%22 = call i32 @sprintf(i8* %18, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%24 = getelementptr inbounds %struct.tm, %struct.tm* %11, i64 0, i32 2
%25 = load i32, i32* %24
%26 = call i32 @sprintf(i8* %23, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%28 = getelementptr inbounds %struct.tm, %struct.tm* %11, i64 0, i32 3
%29 = load i32, i32* %28
%30 = call i32 @sprintf(i8* %27, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%32 = getelementptr inbounds %struct.tm, %struct.tm* %11, i64 0, i32 4
%33 = load i32, i32* %32
%34 = call i32 @sprintf(i8* %31, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%36 = getelementptr inbounds %struct.tm, %struct.tm* %11, i64 0, i32 5
%37 = load i32, i32* %36
%38 = call i32 @sprintf(i8* %35, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %37)
%39 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %13, i8 signext 45, i8* %18, i8 signext 45, i8* %23, i8 signext 84, i8* %27, i8 signext 58, i8* %31, i8 signext 58, i8* %35)
%40 = load i8*, i8** %2
ret i8* %40
}