#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 dummy;
};
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
const char *a_current_time_str(void) {
  static char buffer[25];
  time_t now;
  struct tm tm;
  time(&now);
  localtime_r(&now, &tm);
  if (!strftime(buffer, sizeof(buffer), "%Y-%m-%d %T ", &tm))
    buffer[0] = '\0';
  return buffer;
}


x86 assembly (clang, -O0):
<a_current_time_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <localtime_r@plt>
lea    0x2efb(%rip),%rdi
mov    $0x19,%esi
lea    0xe9f(%rip),%rdx
lea    -0x8(%rbp),%rcx
call   1050 <strftime@plt>
cmp    $0x0,%eax
jne    117a <a_current_time_str+0x4a>
movb   $0x0,0x2ed6(%rip)
lea    0x2ecf(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_current_time_str>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <localtime_r@plt>
lea    0x2efa(%rip),%rdi
lea    0xea3(%rip),%rdx
mov    $0x19,%esi
mov    %r14,%rcx
call   1050 <strftime@plt>
test   %eax,%eax
jne    1175 <a_current_time_str+0x45>
movb   $0x0,0x2edb(%rip)
lea    0x2ed4(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@a_current_time_str.buffer = internal global [25 x i8] zeroinitializer
@.str = [13 x i8] c"%Y-%m-%d %T \00"
define i8* @a_current_time_str() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = call i32 @time(i32* %1)
%4 = call i32 @localtime_r(i32* %1, %struct.tm* %2)
%5 = call i32 @strftime(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @a_current_time_str.buffer, i64 0, i64 0), i32 25, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %0
store i8 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @a_current_time_str.buffer, i64 0, i64 0)
br label %8
8: ; preds = %7, %0
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @a_current_time_str.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@a_current_time_str.buffer = internal global [25 x i8] zeroinitializer
@.str = [13 x i8] c"%Y-%m-%d %T \00"
define i8* @a_current_time_str() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = bitcast i32* %1 to i8*
%4 = bitcast %struct.tm* %2 to i8*
%5 = call i32 @time(i32* %1)
%6 = call i32 @localtime_r(i32* %1, %struct.tm* %2)
%7 = call i32 @strftime(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @a_current_time_str.buffer, i64 0, i64 0), i32 25, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i8 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @a_current_time_str.buffer, i64 0, i64 0)
br label %10
10: ; preds = %9, %0
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @a_current_time_str.buffer, i64 0, i64 0)
}