#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 dummy;
};
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ *gmtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void tPrint(char *s) {
  time_t rawtime;
  char buffer[80];
  struct tm result;
  time(&rawtime);
  if (gmtime_r(&rawtime, &result) != NULL) {
    strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%SZ", &result);
    printf("%s: %s\n", buffer, s);
  }
}


x86 assembly (clang, -O0):
<tPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <time@plt>
lea    -0xc(%rbp),%rdi
lea    -0x68(%rbp),%rsi
call   1040 <gmtime_r@plt>
cmp    $0x0,%rax
je     1199 <tPrint+0x59>
lea    -0x60(%rbp),%rdi
mov    $0x50,%esi
lea    0xe84(%rip),%rdx
lea    -0x68(%rbp),%rcx
call   1060 <strftime@plt>
lea    -0x60(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tPrint>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%r14
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <gmtime_r@plt>
test   %rax,%rax
je     1199 <tPrint+0x59>
lea    0xe90(%rip),%rdx
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1060 <strftime@plt>
lea    0xe85(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [19 x i8] c"%Y-%m-%d %H:%M:%SZ\00"
@.str.1 = [8 x i8] c"%s: %s\0A\00"
define void @tPrint(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [80 x i8]
%5 = alloca %struct.tm
store i8* %0, i8** %2
%6 = call i32 @time(i32* %3)
%7 = call i32* @gmtime_r(i32* %3, %struct.tm* %5)
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%11 = call i32 @strftime(i8* %10, i32 80, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%13 = load i8*, i8** %2
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %12, i8* %13)
br label %15
15: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [19 x i8] c"%Y-%m-%d %H:%M:%SZ\00"
@.str.1 = [8 x i8] c"%s: %s\0A\00"
define void @tPrint(i8* %0) {
%2 = alloca i32
%3 = alloca [80 x i8]
%4 = alloca %struct.tm
%5 = bitcast i32* %2 to i8*
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%7 = bitcast %struct.tm* %4 to i8*
%8 = call i32 @time(i32* %2)
%9 = call i32* @gmtime_r(i32* %2, %struct.tm* %4)
%10 = icmp eq i32* %9, null
br i1 %10, label %14, label %11
11: ; preds = %1
%12 = call i32 @strftime(i8* %6, i32 80, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %0)
br label %14
14: ; preds = %11, %1
ret void
}