#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 */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct utsname {
  char *nodename;
};
struct tm {
  int dummy;
};
struct TYPE_4__ {
  double tv_sec;
  double tv_usec;
};
struct TYPE_3__ {
  double tv_sec;
  double tv_usec;
};
struct rusage {
  TYPE_2__ ru_stime;
  TYPE_1__ ru_utime;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int /*<<< orphan*/ W_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
char *getenv(char *);
char *getlogin();
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ uname(struct utsname *);
void addlog(char *name, int len) {
  char time_string[512];
  char log_string[512];
  char codename[512];
  double u_time, s_time;
  struct utsname sys_info;
  const char *username = NULL;
  if (getenv("SEACAS_NO_LOGGING") != NULL) {
    fprintf(stderr,
            "SEACAS Audit logging disabled via SEACAS_NO_LOGGING setting.\n");
    return;
  }
  username = getlogin();
  if (username == NULL) {
    username = getenv("LOGNAME");
  }
  if (username == NULL) {
    username = "UNKNOWN";
  }
  {
    int i;
    for (i = 0; i < len; i++)
      codename[i] = name[i];
    codename[len] = '\0';
  }
  {
    time_t calendar_time = time(NULL);
    struct tm *local_time = localtime(&calendar_time);
    strftime(time_string, 512, "%a %b %d %H:%M:%S %Z %Y", local_time);
  }
  {
    struct rusage rusage;
    getrusage(RUSAGE_SELF, &rusage);
    u_time = rusage.ru_utime.tv_sec + rusage.ru_utime.tv_usec / 1.0e6;
    s_time = rusage.ru_stime.tv_sec + rusage.ru_stime.tv_usec / 1.0e6;
  }
  uname(&sys_info);
  snprintf(log_string, 512,
           "%s %s %s %.3fu %.3fs 0:00.00 0.0%% 0+0k 0+0io 0pf+0w %s\n",
           codename, username, time_string, u_time, s_time, sys_info.nodename);
  {
    char *access_dir = getenv("ACCESS");
    if (access_dir != NULL) {
      char filename[512];
      snprintf(filename, 512, "%s/etc/audit.log", access_dir);
      if (0 == access(filename, W_OK)) {
        FILE *audit = fopen(filename, "a");
        if (audit != NULL) {
          fprintf(audit, "%s", log_string);
          fclose(audit);
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<addlog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x880,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x630(%rbp)
lea    0xe24(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     1210 <addlog+0x50>
mov    0x2dde(%rip),%rax
movslq (%rax),%rdi
lea    0xe16(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    146b <addlog+0x2ab>
mov    $0x0,%al
call   10a0 <getlogin@plt>
mov    %rax,-0x630(%rbp)
cmpq   $0x0,-0x630(%rbp)
jne    123f <addlog+0x7f>
lea    0xe25(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x630(%rbp)
cmpq   $0x0,-0x630(%rbp)
jne    125b <addlog+0x9b>
lea    0xe0c(%rip),%rax
mov    %rax,-0x630(%rbp)
movl   $0x0,-0x634(%rbp)
mov    -0x634(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12a4 <addlog+0xe4>
mov    -0x8(%rbp),%rax
movslq -0x634(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x634(%rbp),%rax
mov    %cl,-0x610(%rbp,%rax,1)
mov    -0x634(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x634(%rbp)
jmp    1265 <addlog+0xa5>
movslq -0xc(%rbp),%rax
movb   $0x0,-0x610(%rbp,%rax,1)
xor    %eax,%eax
mov    %eax,%edi
call   1090 <time@plt>
mov    %eax,-0x638(%rbp)
lea    -0x638(%rbp),%rdi
call   1040 <localtime@plt>
mov    %rax,-0x640(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x640(%rbp),%rcx
mov    $0x200,%esi
lea    0xd7c(%rip),%rdx
call   10b0 <strftime@plt>
mov    0x2cd8(%rip),%rax
mov    (%rax),%edi
lea    -0x660(%rbp),%rsi
call   10e0 <getrusage@plt>
movsd  -0x650(%rbp),%xmm0
ff
movsd  -0x648(%rbp),%xmm1
ff
movsd  0xce2(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x618(%rbp)
ff
movsd  -0x660(%rbp),%xmm0
ff
movsd  -0x658(%rbp),%xmm1
ff
movsd  0xcba(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x620(%rbp)
ff
lea    -0x628(%rbp),%rdi
call   1070 <uname@plt>
lea    -0x410(%rbp),%rdi
lea    -0x610(%rbp),%rcx
mov    -0x630(%rbp),%r8
lea    -0x210(%rbp),%r9
movsd  -0x618(%rbp),%xmm0
ff
movsd  -0x620(%rbp),%xmm1
ff
mov    -0x628(%rbp),%rax
mov    $0x200,%esi
lea    0xcdf(%rip),%rdx
mov    %rax,(%rsp)
mov    $0x2,%al
call   1060 <snprintf@plt>
lea    0xd06(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x668(%rbp)
cmpq   $0x0,-0x668(%rbp)
je     146b <addlog+0x2ab>
lea    -0x870(%rbp),%rdi
mov    -0x668(%rbp),%rcx
mov    $0x200,%esi
lea    0xcd9(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
lea    -0x870(%rbp),%rdi
mov    0x2bec(%rip),%rax
mov    (%rax),%esi
call   10c0 <access@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1466 <addlog+0x2a6>
lea    -0x870(%rbp),%rdi
lea    0xcb2(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x878(%rbp)
cmpq   $0x0,-0x878(%rbp)
je     1461 <addlog+0x2a1>
mov    -0x878(%rbp),%rdi
lea    -0x410(%rbp),%rdx
lea    0xc85(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x878(%rbp),%rdi
call   1050 <fclose@plt>
jmp    1466 <addlog+0x2a6>
jmp    146b <addlog+0x2ab>
add    $0x880,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addlog>:
push   %rbp
push   %r14
push   %rbx
sub    $0x820,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xe11(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     122c <addlog+0x4c>
mov    0x2dd0(%rip),%rax
movslq (%rax),%rcx
lea    0xe08(%rip),%rdi
mov    $0x3d,%esi
mov    $0x1,%edx
add    $0x820,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1100 <fwrite@plt>
xor    %eax,%eax
call   10b0 <getlogin@plt>
test   %rax,%rax
jne    1244 <addlog+0x64>
lea    0xe19(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xe12(%rip),%r14
cmovne %rax,%r14
test   %ebp,%ebp
jle    1268 <addlog+0x88>
mov    %ebp,%edx
lea    0x220(%rsp),%rdi
mov    %rbx,%rsi
call   1090 <memcpy@plt>
movslq %ebp,%rax
movb   $0x0,0x220(%rsp,%rax,1)
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,0x20(%rsp)
lea    0x20(%rsp),%rdi
call   1040 <localtime@plt>
lea    0xdd9(%rip),%rdx
lea    0x620(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
mov    %rax,%rcx
call   10c0 <strftime@plt>
mov    0x2d22(%rip),%rax
mov    (%rax),%edi
lea    0x20(%rsp),%rsi
call   10f0 <getrusage@plt>
movsd  0x38(%rsp),%xmm1
movsd  0xd38(%rip),%xmm0
divsd  %xmm0,%xmm1
addsd  0x30(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x28(%rsp),%xmm1
divsd  %xmm0,%xmm1
addsd  0x20(%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0x18(%rsp),%rdi
call   1070 <uname@plt>
mov    0x18(%rsp),%rax
mov    %rax,(%rsp)
lea    0xd78(%rip),%rdx
lea    0x20(%rsp),%rdi
lea    0x220(%rsp),%rcx
mov    $0x200,%esi
mov    %r14,%r8
mov    %rbx,%r9
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    $0x2,%al
call   1060 <snprintf@plt>
lea    0xd7f(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     13ac <addlog+0x1cc>
lea    0xd75(%rip),%rdx
lea    0x420(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
mov    %rax,%rcx
xor    %eax,%eax
call   1060 <snprintf@plt>
mov    0x2c7c(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   10d0 <access@plt>
test   %rax,%rax
jne    13ac <addlog+0x1cc>
lea    0xd4f(%rip),%rsi
lea    0x420(%rsp),%rdi
call   10e0 <fopen@plt>
test   %rax,%rax
je     13ac <addlog+0x1cc>
mov    %rax,%rbx
lea    0x20(%rsp),%rdi
mov    %rax,%rsi
call   1080 <fputs@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
add    $0x820,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.utsname = type { i8* }
%struct.tm = type { i32 }
%struct.rusage = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { double, double }
%struct.TYPE_3__ = type { double, double }
@.str = [18 x i8] c"SEACAS_NO_LOGGING\00"
@stderr = global i32 0
@.str.1 = [62 x i8] c"SEACAS Audit logging disabled via SEACAS_NO_LOGGING setting.\0A\00"
@.str.2 = [8 x i8] c"LOGNAME\00"
@.str.3 = [8 x i8] c"UNKNOWN\00"
@.str.4 = [24 x i8] c"%a %b %d %H:%M:%S %Z %Y\00"
@RUSAGE_SELF = global i32 0
@.str.5 = [57 x i8] c"%s %s %s %.3fu %.3fs 0:00.00 0.0%% 0+0k 0+0io 0pf+0w %s\0A\00"
@.str.6 = [7 x i8] c"ACCESS\00"
@.str.7 = [17 x i8] c"%s/etc/audit.log\00"
@W_OK = global i32 0
@.str.8 = [2 x i8] c"a\00"
@.str.9 = [3 x i8] c"%s\00"
define void @addlog(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [512 x i8]
%6 = alloca [512 x i8]
%7 = alloca [512 x i8]
%8 = alloca double
%9 = alloca double
%10 = alloca %struct.utsname
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca %struct.tm*
%15 = alloca %struct.rusage
%16 = alloca i8*
%17 = alloca [512 x i8]
%18 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8* null, i8** %11
%19 = call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %26
21: ; preds = %2
%22 = load i32, i32* @stderr
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
br label %114
26: ; preds = %2
%27 = call i8* (...) @getlogin()
store i8* %27, i8** %11
%28 = load i8*, i8** %11
%29 = icmp eq i8* %28, null
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
store i8* %31, i8** %11
br label %32
32: ; preds = %30, %26
%33 = load i8*, i8** %11
%34 = icmp eq i8* %33, null
br i1 %34, label %35, label %36
35: ; preds = %32
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %11
br label %36
36: ; preds = %35, %32
store i32 0, i32* %12
br label %37
37: ; preds = %50, %36
%38 = load i32, i32* %12
%39 = load i32, i32* %4
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %53
41: ; preds = %37
%42 = load i8*, i8** %3
%43 = load i32, i32* %12
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %42, i64 %44
%46 = load i8, i8* %45
%47 = load i32, i32* %12
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 %48
store i8 %46, i8* %49
br label %50
50: ; preds = %41
%51 = load i32, i32* %12
%52 = add nsw i32 %51, 1
store i32 %52, i32* %12
br label %37
53: ; preds = %37
%54 = load i32, i32* %4
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 %55
store i8 0, i8* %56
%57 = call i32 @time(i32* null)
store i32 %57, i32* %13
%58 = call %struct.tm* @localtime(i32* %13)
store %struct.tm* %58, %struct.tm** %14
%59 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%60 = load %struct.tm*, %struct.tm** %14
%61 = call i32 @strftime(i8* %59, i32 512, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), %struct.tm* %60)
%62 = load i32, i32* @RUSAGE_SELF
%63 = call i32 @getrusage(i32 %62, %struct.rusage* %15)
%64 = getelementptr inbounds %struct.rusage, %struct.rusage* %15, i32 0, i32 1
%65 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %64, i32 0, i32 0
%66 = load double, double* %65
%67 = getelementptr inbounds %struct.rusage, %struct.rusage* %15, i32 0, i32 1
%68 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %67, i32 0, i32 1
%69 = load double, double* %68
%70 = fdiv double %69, 1.000000e+06
%71 = fadd double %66, %70
store double %71, double* %8
%72 = getelementptr inbounds %struct.rusage, %struct.rusage* %15, i32 0, i32 0
%73 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %72, i32 0, i32 0
%74 = load double, double* %73
%75 = getelementptr inbounds %struct.rusage, %struct.rusage* %15, i32 0, i32 0
%76 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %75, i32 0, i32 1
%77 = load double, double* %76
%78 = fdiv double %77, 1.000000e+06
%79 = fadd double %74, %78
store double %79, double* %9
%80 = call i32 @uname(%struct.utsname* %10)
%81 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%82 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%83 = load i8*, i8** %11
%84 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%85 = load double, double* %8
%86 = load double, double* %9
%87 = getelementptr inbounds %struct.utsname, %struct.utsname* %10, i32 0, i32 0
%88 = load i8*, i8** %87
%89 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %81, i32 512, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), i8* %82, i8* %83, i8* %84, double %85, double %86, i8* %88)
%90 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
store i8* %90, i8** %16
%91 = load i8*, i8** %16
%92 = icmp ne i8* %91, null
br i1 %92, label %93, label %114
93: ; preds = %53
%94 = getelementptr inbounds [512 x i8], [512 x i8]* %17, i64 0, i64 0
%95 = load i8*, i8** %16
%96 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %94, i32 512, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* %95)
%97 = getelementptr inbounds [512 x i8], [512 x i8]* %17, i64 0, i64 0
%98 = load i32, i32* @W_OK
%99 = call i64 @access(i8* %97, i32 %98)
%100 = icmp eq i64 0, %99
br i1 %100, label %101, label %113
101: ; preds = %93
%102 = getelementptr inbounds [512 x i8], [512 x i8]* %17, i64 0, i64 0
%103 = call i32* @fopen(i8* %102, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32* %103, i32** %18
%104 = load i32*, i32** %18
%105 = icmp ne i32* %104, null
br i1 %105, label %106, label %112
106: ; preds = %101
%107 = load i32*, i32** %18
%108 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%109 = call i32 (i32*, i8*, ...) @fprintf(i32* %107, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %108)
%110 = load i32*, i32** %18
%111 = call i32 @fclose(i32* %110)
br label %112
112: ; preds = %106, %101
br label %113
113: ; preds = %112, %93
br label %114
114: ; preds = %21, %113, %53
ret void
}

LLVM IR (-O2):
%struct.utsname = type { i8* }
%struct.rusage = type { %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { double, double }
%struct.TYPE_3__ = type { double, double }
%struct.tm = type { i32 }
@.str = [18 x i8] c"SEACAS_NO_LOGGING\00"
@stderr = global i32 0
@.str.1 = [62 x i8] c"SEACAS Audit logging disabled via SEACAS_NO_LOGGING setting.\0A\00"
@.str.2 = [8 x i8] c"LOGNAME\00"
@.str.3 = [8 x i8] c"UNKNOWN\00"
@.str.4 = [24 x i8] c"%a %b %d %H:%M:%S %Z %Y\00"
@RUSAGE_SELF = global i32 0
@.str.5 = [57 x i8] c"%s %s %s %.3fu %.3fs 0:00.00 0.0%% 0+0k 0+0io 0pf+0w %s\0A\00"
@.str.6 = [7 x i8] c"ACCESS\00"
@.str.7 = [17 x i8] c"%s/etc/audit.log\00"
@W_OK = global i32 0
@.str.8 = [2 x i8] c"a\00"
define void @addlog(i8* nocapture %0, i32 %1) {
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = alloca [512 x i8]
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = alloca %struct.utsname
%8 = alloca i32
%9 = alloca %struct.rusage
%10 = alloca [512 x i8]
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%14 = bitcast %struct.utsname* %7 to i8*
%15 = tail call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i8* %15, null
br i1 %16, label %22, label %17
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
%21 = tail call i64 @fwrite(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i64 61, i64 1, i32* %20)
br label %75
22: ; preds = %2
%23 = tail call i8* (...) @getlogin()
%24 = icmp eq i8* %23, null
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = tail call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %25, %22
%28 = phi i8* [ %26, %25 ], [ %23, %22 ]
%29 = icmp eq i8* %28, null
%30 = select i1 %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %28
%31 = icmp sgt i32 %1, 0
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = zext i32 %1 to i64
br label %34
34: ; preds = %32, %27
%35 = sext i32 %1 to i64
%36 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 %35
store i8 0, i8* %36
%37 = bitcast i32* %8 to i8*
%38 = tail call i32 @time(i32* null)
store i32 %38, i32* %8
%39 = call %struct.tm* @localtime(i32* %8)
%40 = call i32 @strftime(i8* %11, i32 512, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), %struct.tm* %39)
%41 = bitcast %struct.rusage* %9 to i8*
%42 = load i32, i32* @RUSAGE_SELF
%43 = call i32 @getrusage(i32 %42, %struct.rusage* %9)
%44 = getelementptr inbounds %struct.rusage, %struct.rusage* %9, i64 0, i32 1, i32 0
%45 = load double, double* %44
%46 = getelementptr inbounds %struct.rusage, %struct.rusage* %9, i64 0, i32 1, i32 1
%47 = load double, double* %46
%48 = fdiv double %47, 1.000000e+06
%49 = fadd double %45, %48
%50 = getelementptr inbounds %struct.rusage, %struct.rusage* %9, i64 0, i32 0, i32 0
%51 = load double, double* %50
%52 = getelementptr inbounds %struct.rusage, %struct.rusage* %9, i64 0, i32 0, i32 1
%53 = load double, double* %52
%54 = fdiv double %53, 1.000000e+06
%55 = fadd double %51, %54
%56 = call i32 @uname(%struct.utsname* %7)
%57 = getelementptr inbounds %struct.utsname, %struct.utsname* %7, i64 0, i32 0
%58 = load i8*, i8** %57
%59 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %12, i32 512, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), i8* %13, i8* %30, i8* %11, double %49, double %55, i8* %58)
%60 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%61 = icmp eq i8* %60, null
br i1 %61, label %75, label %62
62: ; preds = %34
%63 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%64 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %63, i32 512, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* %60)
%65 = load i32, i32* @W_OK
%66 = call i64 @access(i8* %63, i32 %65)
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %74
68: ; preds = %62
%69 = call i32* @fopen(i8* %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%70 = icmp eq i32* %69, null
br i1 %70, label %74, label %71
71: ; preds = %68
%72 = call i32 @fputs(i8* %12, i32* %69)
%73 = call i32 @fclose(i32* %69)
br label %74
74: ; preds = %68, %71, %62
br label %75
75: ; preds = %34, %74, %17
ret void
}