#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;
typedef int /*<<< orphan*/ timeStr;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void GetDateTime4(time_t sec) {
  printf("GetDateTime4:\t");
  char timeStr[20] = {0};
  time_t currentTime = time(NULL);
  strftime(timeStr, sizeof(timeStr), "%Y-%m-%d %H:%M:%S", localtime(&sec));
  printf("%s\n", timeStr);
}


x86 assembly (clang, -O0):
<GetDateTime4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1050 <memset@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%ecx
mov    $0x14,%esi
lea    0xe67(%rip),%rdx
call   1070 <strftime@plt>
lea    -0x20(%rbp),%rsi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDateTime4>:
push   %rbx
sub    $0x30,%rsp
mov    %edi,0xc(%rsp)
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
xor    %edi,%edi
call   1060 <time@plt>
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe80(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %eax,%ecx
call   1070 <strftime@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"GetDateTime4:\09\00"
@.str.1 = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @GetDateTime4(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = bitcast [20 x i8]* %3 to i8*
%7 = call i32 @time(i32* null)
store i32 %7, i32* %4
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%9 = call i32 @localtime(i32* %2)
%10 = call i32 @strftime(i8* %8, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"GetDateTime4:\09\00"
@.str.1 = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define void @GetDateTime4(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
store i32 %0, i32* %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = tail call i32 @time(i32* null)
%7 = call i32 @localtime(i32* %2)
%8 = call i32 @strftime(i8* %5, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @puts(i8* %5)
ret void
}