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

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  char buff[80 * 100];
  time_t ticks;
  ticks = time(NULL);
  snprintf(buff, sizeof(buff), "%.24s\r\n", ctime(&ticks));
  write(0, buff, strlen(buff));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f70,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,-0x1f54(%rbp)
lea    -0x1f50(%rbp),%rax
mov    %rax,-0x1f68(%rbp)
lea    -0x1f54(%rbp),%rdi
call   1040 <ctime@plt>
mov    -0x1f68(%rbp),%rdi
mov    %rax,%rcx
mov    $0x1f40,%esi
lea    0xe5f(%rip),%rdx
call   1060 <snprintf@plt>
lea    -0x1f50(%rbp),%rax
mov    %rax,-0x1f60(%rbp)
lea    -0x1f50(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x1f60(%rbp),%rsi
mov    %eax,%edx
xor    %edi,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x1f70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1f50,%rsp
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1040 <ctime@plt>
lea    0xe8c(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1f40,%esi
mov    %rax,%rcx
call   1060 <snprintf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x1f50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%.24s\0D\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [8000 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = call i32 @time(i32* null)
store i32 %7, i32* %6
%8 = getelementptr inbounds [8000 x i8], [8000 x i8]* %5, i64 0, i64 0
%9 = call i8* @ctime(i32* %6)
%10 = call i32 @snprintf(i8* %8, i32 8000, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [8000 x i8], [8000 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [8000 x i8], [8000 x i8]* %5, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @write(i32 0, i8* %11, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%.24s\0D\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8000 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [8000 x i8], [8000 x i8]* %3, i64 0, i64 0
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 @time(i32* null)
store i32 %7, i32* %4
%8 = call i8* @ctime(i32* %4)
%9 = call i32 @snprintf(i8* %5, i32 8000, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @strlen(i8* %5)
%11 = call i32 @write(i32 0, i8* %5, i32 %10)
ret i32 0
}