#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;

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
char *strchr(char *, char);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *nmrtime() {
  static char ans[25];
  time_t t;
  char *c;
  t = time(NULL);
  c = asctime(localtime(&t));
  strncpy(ans, c, 24);
  ans[24] = '\0';
  if ((c = strchr(ans, '\n')) != NULL)
    *c = '\0';
  return ans;
}


x86 assembly (clang, -O0):
<nmrtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1050 <asctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0x2edd(%rip),%rdi
mov    $0x18,%edx
call   1040 <strncpy@plt>
movb   $0x0,0x2ee4(%rip)
lea    0x2ec5(%rip),%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     11ba <nmrtime+0x6a>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
lea    0x2e9f(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmrtime>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    %eax,%edi
call   1050 <asctime@plt>
lea    0x2ee8(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x18,%edx
call   1040 <strncpy@plt>
movb   $0x0,0x2ee9(%rip)
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     11a4 <nmrtime+0x54>
movb   $0x0,(%rax)
lea    0x2eb5(%rip),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@nmrtime.ans = internal global [25 x i8] zeroinitializer
define i8* @nmrtime() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i32 @localtime(i32* %1)
%5 = call i8* @asctime(i32 %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strncpy(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @nmrtime.ans, i64 0, i64 0), i8* %6, i32 24)
store i8 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @nmrtime.ans, i64 0, i64 24)
%8 = call i8* @strchr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @nmrtime.ans, i64 0, i64 0), i8 signext 10)
store i8* %8, i8** %2
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = load i8*, i8** %2
store i8 0, i8* %11
br label %12
12: ; preds = %10, %0
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @nmrtime.ans, i64 0, i64 0)
}

LLVM IR (-O2):
@nmrtime.ans = internal global [25 x i8] zeroinitializer
define i8* @nmrtime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i32 @localtime(i32* %1)
%5 = call i8* @asctime(i32 %4)
%6 = call i32 @strncpy(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @nmrtime.ans, i64 0, i64 0), i8* %5, i32 24)
store i8 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @nmrtime.ans, i64 0, i64 24)
%7 = call i8* @strchr(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @nmrtime.ans, i64 0, i64 0), i8 signext 10)
%8 = icmp eq i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %0
store i8 0, i8* %7
br label %10
10: ; preds = %9, %0
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @nmrtime.ans, i64 0, i64 0)
}