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

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  time_t now = time(NULL);
  struct tm *nowtm;
  nowtm = localtime(&now);
  char timebuf[128];
  strftime(timebuf, 128, "%a %b %d %X %Z %Y", nowtm);
  printf("%s\n", timebuf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x80,%esi
lea    0xe77(%rip),%rdx
call   1060 <strftime@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe9c(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
lea    0xe92(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%a %b %d %X %Z %Y\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 %struct.tm*
%8 = alloca [128 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @time(i32* null)
store i32 %9, i32* %6
%10 = call %struct.tm* @localtime(i32* %6)
store %struct.tm* %10, %struct.tm** %7
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%12 = load %struct.tm*, %struct.tm** %7
%13 = call i32 @strftime(i8* %11, i32 128, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %12)
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %14)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%a %b %d %X %Z %Y\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [128 x i8]
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 @time(i32* null)
store i32 %6, i32* %3
%7 = call %struct.tm* @localtime(i32* %3)
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%9 = call i32 @strftime(i8* %8, i32 128, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %7)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}