#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 */
struct tm {
  int tm_year;
  int tm_mon;
  int tm_mday;
  int tm_hour;
  int tm_min;
  int tm_sec;
};
struct timeval {
  int tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
void print_run_time(char *pFile, int lLine) {
  struct timeval cur_time;
  struct tm *pstTm;
  int lStringSize = 0, i = 0;
  gettimeofday(&cur_time, (0));
  pstTm = localtime(&(cur_time.tv_sec));
  printf("[%04d-%02d-%02d %02d:%02d:%02d:%03ld] ", pstTm->tm_year + 1900,
         pstTm->tm_mon + 1, pstTm->tm_mday, pstTm->tm_hour, pstTm->tm_min,
         pstTm->tm_sec, (cur_time.tv_usec) / 1000);
  lStringSize = strlen(pFile);
  for (i = (lStringSize - 1); i != 0; i--) {
    if ('/' == *(pFile + i)) {
      break;
    }
  }
  printf("[%s:%d] ", (pFile + i), lLine);
}


x86 assembly (clang, -O0):
<print_run_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
lea    -0x18(%rbp),%rdi
add    $0x4,%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
add    $0x76c,%esi
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x20(%rbp),%rax
mov    0x14(%rax),%r10d
mov    -0x18(%rbp),%eax
mov    $0x3e8,%edi
cltd
idiv   %edi
mov    -0x2c(%rbp),%edx
lea    0xe3a(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     1225 <print_run_time+0xe5>
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x2f,%eax
cmp    %ecx,%eax
jne    1212 <print_run_time+0xd2>
jmp    1225 <print_run_time+0xe5>
jmp    1217 <print_run_time+0xd7>
mov    -0x28(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x28(%rbp)
jmp    11ea <print_run_time+0xaa>
mov    -0x8(%rbp),%rsi
movslq -0x28(%rbp),%rax
add    %rax,%rsi
mov    -0xc(%rbp),%edx
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_run_time>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    $0x76c,%esi
add    (%rax),%esi
mov    0x4(%rax),%edx
mov    0x8(%rax),%ecx
add    $0x1,%edx
mov    0xc(%rax),%r8d
mov    0x10(%rax),%r9d
mov    0x14(%rax),%r10d
movslq 0x8(%rsp),%rax
imul   $0x10624dd3,%rax,%rbp
mov    %rbp,%rax
shr    $0x3f,%rax
sar    $0x26,%rbp
add    %eax,%ebp
lea    0xe60(%rip),%rdi
xor    %eax,%eax
push   %rbp
push   %r10
call   1050 <printf@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
lea    -0x1(%rax),%ecx
nopl   0x0(%rax,%rax,1)
sub    $0x1,%ecx
jb     11d5 <print_run_time+0x95>
lea    -0x1(%rax),%rdx
cmpb   $0x2f,-0x1(%rbx,%rax,1)
mov    %rdx,%rax
jne    11c0 <print_run_time+0x80>
jmp    11d7 <print_run_time+0x97>
xor    %edx,%edx
movslq %edx,%rax
add    %rax,%rbx
lea    0xe43(%rip),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [39 x i8] c"[%04d-%02d-%02d %02d:%02d:%02d:%03ld] \00"
@.str.1 = [9 x i8] c"[%s:%d] \00"
define void @print_run_time(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.timeval
%6 = alloca %struct.tm*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %7
store i32 0, i32* %8
%9 = call i32 @gettimeofday(%struct.timeval* %5, i32 0)
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%11 = call %struct.tm* @localtime(i32* %10)
store %struct.tm* %11, %struct.tm** %6
%12 = load %struct.tm*, %struct.tm** %6
%13 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1900
%16 = load %struct.tm*, %struct.tm** %6
%17 = getelementptr inbounds %struct.tm, %struct.tm* %16, i32 0, i32 1
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1
%20 = load %struct.tm*, %struct.tm** %6
%21 = getelementptr inbounds %struct.tm, %struct.tm* %20, i32 0, i32 2
%22 = load i32, i32* %21
%23 = load %struct.tm*, %struct.tm** %6
%24 = getelementptr inbounds %struct.tm, %struct.tm* %23, i32 0, i32 3
%25 = load i32, i32* %24
%26 = load %struct.tm*, %struct.tm** %6
%27 = getelementptr inbounds %struct.tm, %struct.tm* %26, i32 0, i32 4
%28 = load i32, i32* %27
%29 = load %struct.tm*, %struct.tm** %6
%30 = getelementptr inbounds %struct.tm, %struct.tm* %29, i32 0, i32 5
%31 = load i32, i32* %30
%32 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%33 = load i32, i32* %32
%34 = sdiv i32 %33, 1000
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %19, i32 %22, i32 %25, i32 %28, i32 %31, i32 %34)
%36 = load i8*, i8** %3
%37 = call i32 @strlen(i8* %36)
store i32 %37, i32* %7
%38 = load i32, i32* %7
%39 = sub nsw i32 %38, 1
store i32 %39, i32* %8
br label %40
40: ; preds = %53, %2
%41 = load i32, i32* %8
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %56
43: ; preds = %40
%44 = load i8*, i8** %3
%45 = load i32, i32* %8
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %44, i64 %46
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp eq i32 47, %49
br i1 %50, label %51, label %52
51: ; preds = %43
br label %56
52: ; preds = %43
br label %53
53: ; preds = %52
%54 = load i32, i32* %8
%55 = add nsw i32 %54, -1
store i32 %55, i32* %8
br label %40
56: ; preds = %51, %40
%57 = load i8*, i8** %3
%58 = load i32, i32* %8
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8, i8* %57, i64 %59
%61 = load i32, i32* %4
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %60, i32 %61)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
%struct.tm = type { i32, i32, i32, i32, i32, i32 }
@.str = [39 x i8] c"[%04d-%02d-%02d %02d:%02d:%02d:%03ld] \00"
@.str.1 = [9 x i8] c"[%s:%d] \00"
define void @print_run_time(i8* %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%7 = call %struct.tm* @localtime(i32* %6)
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1900
%11 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 1
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
%14 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 2
%15 = load i32, i32* %14
%16 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 3
%17 = load i32, i32* %16
%18 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 4
%19 = load i32, i32* %18
%20 = getelementptr inbounds %struct.tm, %struct.tm* %7, i64 0, i32 5
%21 = load i32, i32* %20
%22 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%23 = load i32, i32* %22
%24 = sdiv i32 %23, 1000
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %13, i32 %15, i32 %17, i32 %19, i32 %21, i32 %24)
%26 = call i32 @strlen(i8* %0)
%27 = sext i32 %26 to i64
br label %28
28: ; preds = %33, %2
%29 = phi i64 [ %30, %33 ], [ %27, %2 ]
%30 = add nsw i64 %29, -1
%31 = trunc i64 %30 to i32
%32 = icmp eq i32 %31, 0
br i1 %32, label %37, label %33
33: ; preds = %28
%34 = getelementptr inbounds i8, i8* %0, i64 %30
%35 = load i8, i8* %34
%36 = icmp eq i8 %35, 47
br i1 %36, label %37, label %28
37: ; preds = %33, %28
%38 = phi i64 [ %30, %33 ], [ 0, %28 ]
%39 = shl i64 %38, 32
%40 = ashr exact i64 %39, 32
%41 = getelementptr inbounds i8, i8* %0, i64 %40
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %41, i32 %1)
ret void
}