#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*/ buf;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int time(int /*<<< orphan*/ *);
int /*<<< orphan*/ warn(char *);
int main(int argc, char *argv[]) {
  time_t tval;
  char buf[201];
  char format[] = "%a %b %e %H:%M:%S %Y";
  if (time(&tval) == -1) {
    warn("time");
    exit(1);
  }
  strftime(buf, sizeof(buf), format, localtime(&tval));
  printf("%s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe80(%rip),%rax
mov    %rax,-0x100(%rbp)
mov    0xe7a(%rip),%rax
mov    %rax,-0xf8(%rbp)
mov    0xe75(%rip),%eax
mov    %eax,-0xf0(%rbp)
mov    0xe6d(%rip),%al
mov    %al,-0xec(%rbp)
lea    -0x14(%rbp),%rdi
call   1060 <time@plt>
cmp    $0xffffffff,%eax
jne    11d5 <main+0x75>
lea    0xe4f(%rip),%rdi
call   1040 <warn@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    -0xe0(%rbp),%rax
mov    %rax,-0x110(%rbp)
lea    -0x100(%rbp),%rax
mov    %rax,-0x108(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x110(%rbp),%rdi
mov    -0x108(%rbp),%rdx
mov    %eax,%ecx
mov    $0xc9,%esi
call   1070 <strftime@plt>
lea    -0xe0(%rbp),%rsi
lea    0xdf8(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
movaps 0xe91(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x59252053253a4d,%rax
mov    %rax,0x1d(%rsp)
lea    0xc(%rsp),%rdi
call   1060 <time@plt>
cmp    $0xffffffff,%eax
je     11cf <main+0x6f>
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0x30(%rsp),%rbx
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
mov    $0xc9,%esi
mov    %eax,%ecx
call   1070 <strftime@plt>
lea    0xe5e(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret
lea    0xe3f(%rip),%rdi
call   1040 <warn@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@__const.main.format = [21 x i8] c"%a %b %e %H:%M:%S %Y\00"
@.str = [5 x i8] c"time\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [201 x i8]
%8 = alloca [21 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [21 x i8]* %8 to i8*
%10 = call i32 @time(i32* %6)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @warn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = getelementptr inbounds [201 x i8], [201 x i8]* %7, i64 0, i64 0
%17 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 0
%18 = call i32 @localtime(i32* %6)
%19 = call i32 @strftime(i8* %16, i32 201, i8* %17, i32 %18)
%20 = getelementptr inbounds [201 x i8], [201 x i8]* %7, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %20)
ret i32 0
}

LLVM IR (-O2):
@__const.main.format = [21 x i8] c"%a %b %e %H:%M:%S %Y\00"
@.str = [5 x i8] c"time\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [201 x i8]
%5 = alloca [21 x i8]
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [201 x i8], [201 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [21 x i8], [21 x i8]* %5, i64 0, i64 0
%9 = call i32 @time(i32* %3)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @warn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = call i32 @localtime(i32* %3)
%16 = call i32 @strftime(i8* %7, i32 201, i8* %8, i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}