#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*/ sPath;

/* Variables and functions */
int /*<<< orphan*/ get_time(char *);
char *getenv(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void GenMonFileName(char *sFileName) {
  char sTime[15];
  char sPath[255];
  memset(sPath, 0, sizeof(sPath));
  get_time(sTime);
  sTime[8] = 0;
  sprintf(sFileName, "%s/log/mon%6.6s.log", getenv("HOME"), sTime + 2);
  return;
}


x86 assembly (clang, -O0):
<GenMonFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1040 <memset@plt>
lea    -0x17(%rbp),%rdi
call   1050 <get_time@plt>
movb   $0x0,-0xf(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x128(%rbp)
lea    0xe93(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x128(%rbp),%rdi
mov    %rax,%rdx
lea    -0x17(%rbp),%rcx
add    $0x2,%rcx
lea    0xe61(%rip),%rsi
call   1060 <sprintf@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenMonFileName>:
push   %rbx
sub    $0x110,%rsp
mov    %rdi,%rbx
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1040 <memset@plt>
lea    0x1(%rsp),%rdi
call   1050 <get_time@plt>
movb   $0x0,0x9(%rsp)
lea    0xea2(%rip),%rdi
call   1030 <getenv@plt>
lea    0x3(%rsp),%rcx
lea    0xe7d(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1060 <sprintf@plt>
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"%s/log/mon%6.6s.log\00"
@.str.1 = [5 x i8] c"HOME\00"
define void @GenMonFileName(i8* %0) {
%2 = alloca i8*
%3 = alloca [15 x i8]
%4 = alloca [255 x i8]
store i8* %0, i8** %2
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%6 = call i32 @memset(i8* %5, i32 0, i32 255)
%7 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%8 = call i32 @get_time(i8* %7)
%9 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 8
store i8 0, i8* %9
%10 = load i8*, i8** %2
%11 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s/log/mon%6.6s.log\00"
@.str.1 = [5 x i8] c"HOME\00"
define void @GenMonFileName(i8* nocapture writeonly %0) {
%2 = alloca [15 x i8]
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%6 = call i32 @memset(i8* %5, i32 0, i32 255)
%7 = call i32 @get_time(i8* %4)
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 8
store i8 0, i8* %8
%9 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 2
%11 = call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
ret void
}