#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;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char const *);
int /*<<< orphan*/ strncpy(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int log_info(const char *msg, FILE *log) {
  time_t ltime = time(NULL);
  char timestamp[26];
  bzero(timestamp, 26);
  strncpy(timestamp, ctime(&ltime), 24);
  fprintf(log, "%s\t%s\n", timestamp, msg);
  fflush(log);
  return 0;
}


x86 assembly (clang, -O0):
<log_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x1a,%esi
call   1080 <bzero@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <ctime@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
mov    $0x18,%edx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xe42(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <fflush@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_info>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,0xc(%rsp)
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x1a,%esi
call   1080 <bzero@plt>
lea    0xc(%rsp),%rdi
call   1040 <ctime@plt>
mov    %r15,%rdi
mov    %eax,%esi
mov    $0x18,%edx
call   1030 <strncpy@plt>
lea    0xe54(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
mov    %r14,%rcx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1070 <fflush@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s\09%s\0A\00"
define i32 @log_info(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca [26 x i8]
store i8* %0, i8** %3
store i32* %1, i32** %4
%7 = call i32 @time(i32* null)
store i32 %7, i32* %5
%8 = getelementptr inbounds [26 x i8], [26 x i8]* %6, i64 0, i64 0
%9 = call i32 @bzero(i8* %8, i32 26)
%10 = getelementptr inbounds [26 x i8], [26 x i8]* %6, i64 0, i64 0
%11 = call i32 @ctime(i32* %5)
%12 = call i32 @strncpy(i8* %10, i32 %11, i32 24)
%13 = load i32*, i32** %4
%14 = getelementptr inbounds [26 x i8], [26 x i8]* %6, i64 0, i64 0
%15 = load i8*, i8** %3
%16 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
%17 = load i32*, i32** %4
%18 = call i32 @fflush(i32* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s\09%s\0A\00"
define i32 @log_info(i8* %0, i32* nocapture %1) {
%3 = alloca i32
%4 = alloca [26 x i8]
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 @time(i32* null)
store i32 %6, i32* %3
%7 = getelementptr inbounds [26 x i8], [26 x i8]* %4, i64 0, i64 0
%8 = call i32 @bzero(i8* %7, i32 26)
%9 = call i32 @ctime(i32* %3)
%10 = call i32 @strncpy(i8* %7, i32 %9, i32 24)
%11 = call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %0)
%12 = call i32 @fflush(i32* %1)
ret i32 0
}