#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 scalar_t__ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
struct tm *localtime(scalar_t__ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
scalar_t__ time(int /*<<< orphan*/ *);
char *now() {
  char *ret = (char *)malloc(200);
  assert(ret != NULL);
  time_t t = time(NULL);
  assert(t != ((time_t)-1));
  struct tm *tmp = localtime(&t);
  strftime(ret, 200, "%F %T", tmp);
  return ret;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0xc8,%edi
call   1060 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0xc8,%esi
lea    0xe48(%rip),%rdx
call   1070 <strftime@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
push   %rbx
sub    $0x10,%rsp
mov    $0xc8,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %rax,0x8(%rsp)
xor    %edi,%edi
cmp    $0xffffffffffffffff,%rax
setne  %dil
call   1040 <assert@plt>
lea    0x8(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe64(%rip),%rdx
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    %rax,%rcx
call   1070 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [6 x i8] c"%F %T\00"
define i8* @now() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca %struct.tm*
%4 = call i64 @malloc(i32 200)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i64 @time(i32* null)
store i64 %10, i64* %2
%11 = load i64, i64* %2
%12 = icmp ne i64 %11, -1
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call %struct.tm* @localtime(i64* %2)
store %struct.tm* %15, %struct.tm** %3
%16 = load i8*, i8** %1
%17 = load %struct.tm*, %struct.tm** %3
%18 = call i32 @strftime(i8* %16, i32 200, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %struct.tm* %17)
%19 = load i8*, i8** %1
ret i8* %19
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [6 x i8] c"%F %T\00"
define i8* @now() {
%1 = alloca i64
%2 = tail call i64 @malloc(i32 200)
%3 = inttoptr i64 %2 to i8*
%4 = icmp ne i64 %2, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = bitcast i64* %1 to i8*
%8 = tail call i64 @time(i32* null)
store i64 %8, i64* %1
%9 = icmp ne i64 %8, -1
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = call %struct.tm* @localtime(i64* %1)
%13 = call i32 @strftime(i8* %3, i32 200, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %struct.tm* %12)
ret i8* %3
}