#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;
struct tm {
  int dummy;
};

/* Variables and functions */
scalar_t__ INT_MAX;
char *asctime(struct tm *);
char *ctime(scalar_t__ *);
struct tm *localtime(scalar_t__ *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  time_t t = INT_MAX - 1;
  struct tm *ptr = localtime(&t);
  printf("%lu\n", sizeof(time_t));
  printf("%s", ctime(&t));
  printf("%s", asctime(ptr));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
lea    0xe84(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x18(%rbp),%rdi
call   1040 <ctime@plt>
mov    %rax,%rsi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <asctime@plt>
mov    %rax,%rsi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e9d(%rip),%rax
mov    (%rax),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <localtime@plt>
mov    %rax,%rbx
lea    0xe95(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   1040 <ctime@plt>
lea    0xe7f(%rip),%r14
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1050 <asctime@plt>
mov    %r14,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@INT_MAX = global i64 0
@.str = [5 x i8] c"%lu\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca %struct.tm*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i64, i64* @INT_MAX
%9 = sub nsw i64 %8, 1
store i64 %9, i64* %6
%10 = call %struct.tm* @localtime(i64* %6)
store %struct.tm* %10, %struct.tm** %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 8)
%12 = call i8* @ctime(i64* %6)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load %struct.tm*, %struct.tm** %7
%15 = call i8* @asctime(%struct.tm* %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@INT_MAX = global i64 0
@.str = [5 x i8] c"%lu\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = load i64, i64* @INT_MAX
%6 = add nsw i64 %5, -1
store i64 %6, i64* %3
%7 = call %struct.tm* @localtime(i64* %3)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 8)
%9 = call i8* @ctime(i64* %3)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i8* @asctime(%struct.tm* %7)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}