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

/* Variables and functions */
char *asctime(int /*<<< orphan*/);
char *ctime(int *);
int /*<<< orphan*/ gmtime(int *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  time_t time = 0x7fffffff;
  printf("biggest time is: %s\n", ctime(&time));
  printf("\n\t *** another version ***\n");
  printf("time is: %s\n", asctime(gmtime(&time)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7fffffff,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1060 <gmtime@plt>
mov    %eax,%edi
call   1040 <asctime@plt>
mov    %rax,%rsi
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x7fffffff,0xc(%rsp)
7f
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <ctime@plt>
lea    0xe8f(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1070 <gmtime@plt>
mov    %eax,%edi
call   1050 <asctime@plt>
lea    0xe6b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"biggest time is: %s\0A\00"
@.str.1 = [28 x i8] c"\0A\09 *** another version ***\0A\00"
@.str.2 = [13 x i8] c"time is: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2147483647, i32* %2
%3 = call i8* @ctime(i32* %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @gmtime(i32* %2)
%7 = call i8* @asctime(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"biggest time is: %s\0A\00"
@.str.2 = [13 x i8] c"time is: %s\0A\00"
@str = [27 x i8] c"\0A\09 *** another version ***\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2147483647, i32* %1
%3 = call i8* @ctime(i32* %1)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%6 = call i32 @gmtime(i32* %1)
%7 = call i8* @asctime(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}