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

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
char *ctime(scalar_t__ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ programDescription();
int /*<<< orphan*/ stderr;
scalar_t__ time(int /*<<< orphan*/ *);
int main(void) {
  programDescription();
  time_t current_time;
  char *c_time_string;
  current_time = time(NULL);
  if (current_time == ((time_t)-1)) {
    (void)fprintf(stderr, "Failure to compute the current time. ");
    return EXIT_FAILURE;
  }
  c_time_string = ctime(&current_time);
  if (c_time_string == NULL) {
    (void)fprintf(stderr, "Failure to convert the current time.");
    return EXIT_FAILURE;
  }
  (void)printf("Current time is %s", c_time_string);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <programDescription@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    11a4 <main+0x54>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xe72(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11fe <main+0xae>
lea    -0x10(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11e2 <main+0x92>
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
lea    0xe5a(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e00(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11fe <main+0xae>
mov    -0x18(%rbp),%rsi
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dd7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <programDescription@plt>
xor    %edi,%edi
call   1060 <time@plt>
mov    %rax,(%rsp)
cmp    $0xffffffffffffffff,%rax
je     118e <main+0x3e>
mov    %rsp,%rdi
call   1030 <ctime@plt>
test   %rax,%rax
je     11a0 <main+0x50>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    0x2e44(%rip),%rax
jmp    11bc <main+0x6c>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
lea    0xe62(%rip),%rsi
jmp    11b0 <main+0x60>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
lea    0xe76(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e1c(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"Failure to compute the current time. \00"
@EXIT_FAILURE = global i32 0
@.str.1 = [37 x i8] c"Failure to convert the current time.\00"
@.str.2 = [19 x i8] c"Current time is %s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 (...) @programDescription()
%5 = call i64 @time(i32* null)
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %1
br label %24
12: ; preds = %0
%13 = call i8* @ctime(i64* %2)
store i8* %13, i8** %3
%14 = load i8*, i8** %3
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%19 = load i32, i32* @EXIT_FAILURE
store i32 %19, i32* %1
br label %24
20: ; preds = %12
%21 = load i8*, i8** %3
%22 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %21)
%23 = load i32, i32* @EXIT_SUCCESS
store i32 %23, i32* %1
br label %24
24: ; preds = %20, %16, %8
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"Failure to compute the current time. \00"
@EXIT_FAILURE = global i32 0
@.str.1 = [37 x i8] c"Failure to convert the current time.\00"
@.str.2 = [19 x i8] c"Current time is %s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i64
%2 = tail call i32 (...) @programDescription()
%3 = bitcast i64* %1 to i8*
%4 = tail call i64 @time(i32* null)
store i64 %4, i64* %1
%5 = icmp eq i64 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %17
9: ; preds = %0
%10 = call i8* @ctime(i64* %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %17
15: ; preds = %9
%16 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %10)
br label %17
17: ; preds = %15, %12, %6
%18 = phi i32* [ @EXIT_FAILURE, %6 ], [ @EXIT_FAILURE, %12 ], [ @EXIT_SUCCESS, %15 ]
%19 = load i32, i32* %18
ret i32 %19
}