#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*/ timestr;
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ print_to_status(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void time_status_print() {
  char timestr[40] = "";
  time_t t = time(NULL);
  struct tm now;
  localtime_r(&t, &now);
  strftime(timestr, sizeof(timestr), "%H:%M %d %b %Y", &now);
  print_to_status(timestr, 0);
}


x86 assembly (clang, -O0):
<time_status_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0x34(%rbp)
lea    -0x34(%rbp),%rdi
lea    -0x38(%rbp),%rsi
call   1030 <localtime_r@plt>
lea    -0x30(%rbp),%rdi
mov    $0x28,%esi
lea    0xe6f(%rip),%rdx
lea    -0x38(%rbp),%rcx
call   1070 <strftime@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
call   1050 <print_to_status@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_status_print>:
push   %r14
push   %rbx
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x30(%rsp)
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%r14
mov    %r14,%rsi
call   1030 <localtime_r@plt>
lea    0xe7f(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x28,%esi
mov    %r14,%rcx
call   1060 <strftime@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <print_to_status@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [15 x i8] c"%H:%M %d %b %Y\00"
define void @time_status_print() {
%1 = alloca [40 x i8]
%2 = alloca i32
%3 = alloca %struct.tm
%4 = bitcast [40 x i8]* %1 to i8*
%5 = call i32 @time(i32* null)
store i32 %5, i32* %2
%6 = call i32 @localtime_r(i32* %2, %struct.tm* %3)
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%8 = call i32 @strftime(i8* %7, i32 40, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%10 = call i32 @print_to_status(i8* %9, i32 0)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [15 x i8] c"%H:%M %d %b %Y\00"
define void @time_status_print() {
%1 = alloca [40 x i8]
%2 = alloca i32
%3 = alloca %struct.tm
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 @time(i32* null)
store i32 %6, i32* %2
%7 = bitcast %struct.tm* %3 to i8*
%8 = call i32 @localtime_r(i32* %2, %struct.tm* %3)
%9 = call i32 @strftime(i8* %4, i32 40, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
%10 = call i32 @print_to_status(i8* %4, i32 0)
ret void
}