#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 tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_year;
  scalar_t__ tm_wday;
  scalar_t__ tm_mon;
};

/* Variables and functions */
char *asctime(struct tm *);
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  struct tm t;
  t.tm_sec = 10;
  t.tm_min = 10;
  t.tm_hour = 6;
  t.tm_mday = 25;
  t.tm_mon = 0;
  t.tm_year = 115;
  t.tm_wday = 0;
  char *time_str = asctime(&t);
  puts(time_str);
  time_t cur;
  cur = time(NULL);
  puts(ctime(&cur));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x30(%rbp)
movl   $0xa,-0x2c(%rbp)
movl   $0x6,-0x28(%rbp)
movl   $0x19,-0x24(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x73,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <asctime@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0x3c(%rbp)
lea    -0x3c(%rbp),%rdi
call   1040 <ctime@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x73,0x20(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x28(%rsp)
lea    0x10(%rsp),%rdi
call   1050 <asctime@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1040 <ctime@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i64, i64 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tm
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
store i32 10, i32* %5
%6 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 1
store i32 10, i32* %6
%7 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 2
store i32 6, i32* %7
%8 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 3
store i32 25, i32* %8
%9 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 6
store i64 0, i64* %9
%10 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 4
store i32 115, i32* %10
%11 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 5
store i64 0, i64* %11
%12 = call i8* @asctime(%struct.tm* %2)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = call i32 @puts(i8* %13)
%15 = call i32 @time(i32* null)
store i32 %15, i32* %4
%16 = call i8* @ctime(i32* %4)
%17 = call i32 @puts(i8* %16)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i64, i64 }
define i32 @main() {
%1 = alloca %struct.tm
%2 = alloca i32
%3 = bitcast %struct.tm* %1 to i8*
%4 = bitcast %struct.tm* %1 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 6, i32 25>, <4 x i32>* %4
%5 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 4
store i32 115, i32* %5
%6 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 5
%7 = bitcast i64* %6 to <2 x i64>*
store <2 x i64> zeroinitializer, <2 x i64>* %7
%8 = call i8* @asctime(%struct.tm* %1)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
%10 = bitcast i32* %2 to i8*
%11 = call i32 @time(i32* null)
store i32 %11, i32* %2
%12 = call i8* @ctime(i32* %2)
%13 = call i32 @puts(i8* dereferenceable(1) %12)
ret i32 0
}