#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_hour;
  int tm_min;
  int tm_sec;
};
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};
typedef int pid_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
char *getenv(char *);
struct tm *gmtime(scalar_t__ *);
struct tm *localtime(scalar_t__ *);
int /*<<< orphan*/ *stdout;
void print_args(struct timeval *stimev, struct timeval *etimev, pid_t ppid,
                pid_t pid, int exitcode, int mlevel, const char *cwd, int argc,
                char *argv[]) {
  struct tm *rlc;
  int i;
  const char *logfile;
  FILE *fp;
  struct timeval dtimev;
  fp = stdout;
  logfile = getenv("MAKE_LOGGER_LOG");
  if (logfile != NULL) {
    fp = fopen(logfile, "a");
    if (fp == NULL)
      fp = stdout;
  }
  rlc = localtime(&(etimev->tv_sec));
  fprintf(fp, "%3d,%3d: %02d:%02d:%02d.%03d ", ppid, pid, rlc->tm_hour,
          rlc->tm_min, rlc->tm_sec, etimev->tv_usec / 1000);
  dtimev.tv_sec = etimev->tv_sec - stimev->tv_sec;
  dtimev.tv_usec = etimev->tv_usec - stimev->tv_usec;
  if (dtimev.tv_usec < 0) {
    dtimev.tv_usec += 1000000;
    dtimev.tv_sec--;
  }
  rlc = gmtime(&(dtimev.tv_sec));
  fprintf(fp, "%2d:%02d:%02d.%03d (%d) ", rlc->tm_hour, rlc->tm_min,
          rlc->tm_sec, dtimev.tv_usec / 1000, mlevel);
  if (exitcode < 0)
    fprintf(fp, "start   : ");
  else
    fprintf(fp, "exit(%d) : ", exitcode);
  fprintf(fp, "%s/  ", cwd);
  for (i = 0; i < argc; i++)
    fprintf(fp, "%s%s", argv[i], (i + 1 < argc) ? " " : "");
  if (mlevel == 0 && exitcode >= 0)
    fprintf(fp, "\n\n");
  else
    fprintf(fp, "\n");
  if (fp != stdout)
    fclose(fp);
}


x86 assembly (clang, -O0):
<print_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    0x2e50(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
lea    0xe62(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     11e4 <print_args+0x84>
mov    -0x38(%rbp),%rdi
lea    0xe53(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    11df <print_args+0x7f>
mov    0x2e08(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
jmp    11e4 <print_args+0x84>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
call   1040 <localtime@plt>
mov    %rax,-0x28(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x14(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%r9d
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%r10d
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    $0x3e8,%esi
cltd
idiv   %esi
mov    -0x54(%rbp),%edx
lea    0xde1(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    -0x8(%rbp),%rcx
sub    0x8(%rcx),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x50(%rbp)
cmpl   $0x0,-0x50(%rbp)
jge    1284 <print_args+0x124>
mov    -0x50(%rbp),%eax
add    $0xf4240,%eax
mov    %eax,-0x50(%rbp)
mov    -0x48(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x48(%rbp)
lea    -0x50(%rbp),%rdi
add    $0x8,%rdi
call   1080 <gmtime@plt>
mov    %rax,-0x28(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%r8d
mov    -0x50(%rbp),%eax
mov    $0x3e8,%esi
cltd
idiv   %esi
mov    -0x58(%rbp),%edx
mov    %eax,%r9d
mov    -0x20(%rbp),%eax
lea    0xd64(%rip),%rsi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
cmpl   $0x0,-0x1c(%rbp)
jge    12f7 <print_args+0x197>
mov    -0x40(%rbp),%rdi
lea    0xd5e(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    130c <print_args+0x1ac>
mov    -0x40(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xd4f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x40(%rbp),%rdi
mov    0x10(%rbp),%rdx
lea    0xd45(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    1380 <print_args+0x220>
mov    -0x40(%rbp),%rdi
mov    0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x2c(%rbp),%esi
add    $0x1,%esi
mov    0x18(%rbp),%r8d
lea    0xd17(%rip),%rcx
lea    0xd07(%rip),%rax
cmp    %r8d,%esi
cmovl  %rax,%rcx
lea    0xcfb(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1329 <print_args+0x1c9>
cmpl   $0x0,-0x20(%rbp)
jne    13ab <print_args+0x24b>
cmpl   $0x0,-0x1c(%rbp)
jl     13ab <print_args+0x24b>
mov    -0x40(%rbp),%rdi
lea    0xccc(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    13bd <print_args+0x25d>
mov    -0x40(%rbp),%rdi
lea    0xcb6(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x40(%rbp),%rax
mov    0x2c18(%rip),%rcx
cmp    (%rcx),%rax
je     13da <print_args+0x27a>
mov    -0x40(%rbp),%rdi
call   1050 <fclose@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_args>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x10(%rsp)
mov    %r8d,0xc(%rsp)
mov    %ecx,%r13d
mov    %edx,%r14d
mov    %rsi,%rbp
mov    %rdi,%r12
mov    0x2e35(%rip),%rbx
mov    (%rbx),%r15
lea    0xe4b(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     11d9 <print_args+0x59>
lea    0xe4a(%rip),%rsi
mov    %rax,%rdi
call   1080 <fopen@plt>
mov    %rax,%r15
test   %rax,%rax
jne    11d9 <print_args+0x59>
mov    (%rbx),%r15
lea    0x8(%rbp),%rdi
call   1040 <localtime@plt>
mov    (%rax),%r8d
mov    0x4(%rax),%r9d
mov    0x8(%rax),%r10d
movslq 0x0(%rbp),%rax
imul   $0x10624dd3,%rax,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x26,%rbx
add    %eax,%ebx
lea    0xe06(%rip),%rsi
mov    %r15,%rdi
mov    %r14d,%edx
mov    %r13d,%ecx
xor    %eax,%eax
push   %rbx
push   %r10
call   1070 <fprintf@plt>
add    $0x10,%rsp
mov    0x8(%rbp),%rax
sub    0x8(%r12),%rax
lea    0x20(%rsp),%rdi
mov    %rax,0x20(%rsp)
mov    0x0(%rbp),%ecx
sub    (%r12),%ecx
mov    %ecx,0x18(%rsp)
jns    1256 <print_args+0xd6>
add    $0xf4240,%ecx
mov    %ecx,0x18(%rsp)
add    $0xffffffffffffffff,%rax
mov    %rax,0x20(%rsp)
mov    0x68(%rsp),%ebp
mov    0x60(%rsp),%r14
call   1090 <gmtime@plt>
mov    (%rax),%edx
mov    0x4(%rax),%ecx
mov    0x8(%rax),%r8d
movslq 0x18(%rsp),%rax
imul   $0x10624dd3,%rax,%r9
mov    %r9,%rax
shr    $0x3f,%rax
sar    $0x26,%r9
add    %eax,%r9d
sub    $0x8,%rsp
lea    0xd9e(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
push   0x18(%rsp)
call   1070 <fprintf@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%edx
test   %edx,%edx
js     12bf <print_args+0x13f>
lea    0xda1(%rip),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    12d8 <print_args+0x158>
lea    0xd83(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10a0 <fwrite@plt>
lea    0xd81(%rip),%rsi
mov    %r15,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %ebp,%ebp
jle    134a <print_args+0x1ca>
mov    %ebp,%r13d
mov    %r13,%rbx
neg    %rbx
mov    $0x1,%ebp
lea    0xd68(%rip),%r14
lea    0xd5a(%rip),%r12
nopl   0x0(%rax)
mov    0x70(%rsp),%rax
mov    -0x8(%rax,%rbp,8),%rdx
cmp    %r13,%rbp
mov    %r14,%rcx
lea    0xd3d(%rip),%rax
cmovb  %rax,%rcx
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    (%rbx,%rbp,1),%rax
add    $0x1,%rax
add    $0x1,%rbp
cmp    $0x1,%rax
jne    1310 <print_args+0x190>
cmpl   $0x0,0xc(%rsp)
js     1373 <print_args+0x1f3>
cmpl   $0x0,0x10(%rsp)
jne    1373 <print_args+0x1f3>
lea    0xd0c(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   10a0 <fwrite@plt>
jmp    1380 <print_args+0x200>
mov    $0xa,%edi
mov    %r15,%rsi
call   1060 <fputc@plt>
mov    0x2c59(%rip),%rax
cmp    (%rax),%r15
je     1394 <print_args+0x214>
mov    %r15,%rdi
call   1050 <fclose@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
%struct.tm = type { i32, i32, i32 }
@stdout = global i32* null
@.str = [16 x i8] c"MAKE_LOGGER_LOG\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [30 x i8] c"%3d,%3d: %02d:%02d:%02d.%03d \00"
@.str.3 = [25 x i8] c"%2d:%02d:%02d.%03d (%d) \00"
@.str.4 = [11 x i8] c"start : \00"
@.str.5 = [12 x i8] c"exit(%d) : \00"
@.str.6 = [6 x i8] c"%s/ \00"
@.str.7 = [5 x i8] c"%s%s\00"
@.str.8 = [2 x i8] c" \00"
@.str.9 = [1 x i8] zeroinitializer
@.str.10 = [3 x i8] c"\0A\0A\00"
@.str.11 = [2 x i8] c"\0A\00"
define void @print_args(%struct.timeval* %0, %struct.timeval* %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i8** %8) {
%10 = alloca %struct.timeval*
%11 = alloca %struct.timeval*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i8**
%19 = alloca %struct.tm*
%20 = alloca i32
%21 = alloca i8*
%22 = alloca i32*
%23 = alloca %struct.timeval
store %struct.timeval* %0, %struct.timeval** %10
store %struct.timeval* %1, %struct.timeval** %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i8* %6, i8** %16
store i32 %7, i32* %17
store i8** %8, i8*** %18
%24 = load i32*, i32** @stdout
store i32* %24, i32** %22
%25 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* %25, i8** %21
%26 = load i8*, i8** %21
%27 = icmp ne i8* %26, null
br i1 %27, label %28, label %36
28: ; preds = %9
%29 = load i8*, i8** %21
%30 = call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %30, i32** %22
%31 = load i32*, i32** %22
%32 = icmp eq i32* %31, null
br i1 %32, label %33, label %35
33: ; preds = %28
%34 = load i32*, i32** @stdout
store i32* %34, i32** %22
br label %35
35: ; preds = %33, %28
br label %36
36: ; preds = %35, %9
%37 = load %struct.timeval*, %struct.timeval** %11
%38 = getelementptr inbounds %struct.timeval, %struct.timeval* %37, i32 0, i32 1
%39 = call %struct.tm* @localtime(i64* %38)
store %struct.tm* %39, %struct.tm** %19
%40 = load i32*, i32** %22
%41 = load i32, i32* %12
%42 = load i32, i32* %13
%43 = load %struct.tm*, %struct.tm** %19
%44 = getelementptr inbounds %struct.tm, %struct.tm* %43, i32 0, i32 0
%45 = load i32, i32* %44
%46 = load %struct.tm*, %struct.tm** %19
%47 = getelementptr inbounds %struct.tm, %struct.tm* %46, i32 0, i32 1
%48 = load i32, i32* %47
%49 = load %struct.tm*, %struct.tm** %19
%50 = getelementptr inbounds %struct.tm, %struct.tm* %49, i32 0, i32 2
%51 = load i32, i32* %50
%52 = load %struct.timeval*, %struct.timeval** %11
%53 = getelementptr inbounds %struct.timeval, %struct.timeval* %52, i32 0, i32 0
%54 = load i32, i32* %53
%55 = sdiv i32 %54, 1000
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %41, i32 %42, i32 %45, i32 %48, i32 %51, i32 %55)
%57 = load %struct.timeval*, %struct.timeval** %11
%58 = getelementptr inbounds %struct.timeval, %struct.timeval* %57, i32 0, i32 1
%59 = load i64, i64* %58
%60 = load %struct.timeval*, %struct.timeval** %10
%61 = getelementptr inbounds %struct.timeval, %struct.timeval* %60, i32 0, i32 1
%62 = load i64, i64* %61
%63 = sub nsw i64 %59, %62
%64 = getelementptr inbounds %struct.timeval, %struct.timeval* %23, i32 0, i32 1
store i64 %63, i64* %64
%65 = load %struct.timeval*, %struct.timeval** %11
%66 = getelementptr inbounds %struct.timeval, %struct.timeval* %65, i32 0, i32 0
%67 = load i32, i32* %66
%68 = load %struct.timeval*, %struct.timeval** %10
%69 = getelementptr inbounds %struct.timeval, %struct.timeval* %68, i32 0, i32 0
%70 = load i32, i32* %69
%71 = sub nsw i32 %67, %70
%72 = getelementptr inbounds %struct.timeval, %struct.timeval* %23, i32 0, i32 0
store i32 %71, i32* %72
%73 = getelementptr inbounds %struct.timeval, %struct.timeval* %23, i32 0, i32 0
%74 = load i32, i32* %73
%75 = icmp slt i32 %74, 0
br i1 %75, label %76, label %83
76: ; preds = %36
%77 = getelementptr inbounds %struct.timeval, %struct.timeval* %23, i32 0, i32 0
%78 = load i32, i32* %77
%79 = add nsw i32 %78, 1000000
store i32 %79, i32* %77
%80 = getelementptr inbounds %struct.timeval, %struct.timeval* %23, i32 0, i32 1
%81 = load i64, i64* %80
%82 = add nsw i64 %81, -1
store i64 %82, i64* %80
br label %83
83: ; preds = %76, %36
%84 = getelementptr inbounds %struct.timeval, %struct.timeval* %23, i32 0, i32 1
%85 = call %struct.tm* @gmtime(i64* %84)
store %struct.tm* %85, %struct.tm** %19
%86 = load i32*, i32** %22
%87 = load %struct.tm*, %struct.tm** %19
%88 = getelementptr inbounds %struct.tm, %struct.tm* %87, i32 0, i32 0
%89 = load i32, i32* %88
%90 = load %struct.tm*, %struct.tm** %19
%91 = getelementptr inbounds %struct.tm, %struct.tm* %90, i32 0, i32 1
%92 = load i32, i32* %91
%93 = load %struct.tm*, %struct.tm** %19
%94 = getelementptr inbounds %struct.tm, %struct.tm* %93, i32 0, i32 2
%95 = load i32, i32* %94
%96 = getelementptr inbounds %struct.timeval, %struct.timeval* %23, i32 0, i32 0
%97 = load i32, i32* %96
%98 = sdiv i32 %97, 1000
%99 = load i32, i32* %15
%100 = call i32 (i32*, i8*, ...) @fprintf(i32* %86, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %89, i32 %92, i32 %95, i32 %98, i32 %99)
%101 = load i32, i32* %14
%102 = icmp slt i32 %101, 0
br i1 %102, label %103, label %106
103: ; preds = %83
%104 = load i32*, i32** %22
%105 = call i32 (i32*, i8*, ...) @fprintf(i32* %104, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %110
106: ; preds = %83
%107 = load i32*, i32** %22
%108 = load i32, i32* %14
%109 = call i32 (i32*, i8*, ...) @fprintf(i32* %107, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %108)
br label %110
110: ; preds = %106, %103
%111 = load i32*, i32** %22
%112 = load i8*, i8** %16
%113 = call i32 (i32*, i8*, ...) @fprintf(i32* %111, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* %112)
store i32 0, i32* %20
br label %114
114: ; preds = %132, %110
%115 = load i32, i32* %20
%116 = load i32, i32* %17
%117 = icmp slt i32 %115, %116
br i1 %117, label %118, label %135
118: ; preds = %114
%119 = load i32*, i32** %22
%120 = load i8**, i8*** %18
%121 = load i32, i32* %20
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds i8*, i8** %120, i64 %122
%124 = load i8*, i8** %123
%125 = load i32, i32* %20
%126 = add nsw i32 %125, 1
%127 = load i32, i32* %17
%128 = icmp slt i32 %126, %127
%129 = zext i1 %128 to i64
%130 = select i1 %128, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0)
%131 = call i32 (i32*, i8*, ...) @fprintf(i32* %119, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %124, i8* %130)
br label %132
132: ; preds = %118
%133 = load i32, i32* %20
%134 = add nsw i32 %133, 1
store i32 %134, i32* %20
br label %114
135: ; preds = %114
%136 = load i32, i32* %15
%137 = icmp eq i32 %136, 0
br i1 %137, label %138, label %144
138: ; preds = %135
%139 = load i32, i32* %14
%140 = icmp sge i32 %139, 0
br i1 %140, label %141, label %144
141: ; preds = %138
%142 = load i32*, i32** %22
%143 = call i32 (i32*, i8*, ...) @fprintf(i32* %142, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %147
144: ; preds = %138, %135
%145 = load i32*, i32** %22
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %145, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
br label %147
147: ; preds = %144, %141
%148 = load i32*, i32** %22
%149 = load i32*, i32** @stdout
%150 = icmp ne i32* %148, %149
br i1 %150, label %151, label %154
151: ; preds = %147
%152 = load i32*, i32** %22
%153 = call i32 @fclose(i32* %152)
br label %154
154: ; preds = %151, %147
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
%struct.tm = type { i32, i32, i32 }
@stdout = global i32* null
@.str = [16 x i8] c"MAKE_LOGGER_LOG\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [30 x i8] c"%3d,%3d: %02d:%02d:%02d.%03d \00"
@.str.3 = [25 x i8] c"%2d:%02d:%02d.%03d (%d) \00"
@.str.4 = [11 x i8] c"start : \00"
@.str.5 = [12 x i8] c"exit(%d) : \00"
@.str.6 = [6 x i8] c"%s/ \00"
@.str.7 = [5 x i8] c"%s%s\00"
@.str.8 = [2 x i8] c" \00"
@.str.9 = [1 x i8] zeroinitializer
@.str.10 = [3 x i8] c"\0A\0A\00"
define void @print_args(%struct.timeval* nocapture %0, %struct.timeval* %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7, i8** nocapture %8) {
%10 = alloca %struct.timeval
%11 = bitcast %struct.timeval* %10 to i8*
%12 = load i32*, i32** @stdout
%13 = tail call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i8* %13, null
br i1 %14, label %20, label %15
15: ; preds = %9
%16 = tail call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i32* %16, null
%18 = load i32*, i32** @stdout
%19 = select i1 %17, i32* %18, i32* %16
br label %20
20: ; preds = %15, %9
%21 = phi i32* [ %12, %9 ], [ %19, %15 ]
%22 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%23 = tail call %struct.tm* @localtime(i64* %22)
%24 = getelementptr inbounds %struct.tm, %struct.tm* %23, i64 0, i32 0
%25 = load i32, i32* %24
%26 = getelementptr inbounds %struct.tm, %struct.tm* %23, i64 0, i32 1
%27 = load i32, i32* %26
%28 = getelementptr inbounds %struct.tm, %struct.tm* %23, i64 0, i32 2
%29 = load i32, i32* %28
%30 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%31 = load i32, i32* %30
%32 = sdiv i32 %31, 1000
%33 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %2, i32 %3, i32 %25, i32 %27, i32 %29, i32 %32)
%34 = load i64, i64* %22
%35 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%36 = load i64, i64* %35
%37 = sub nsw i64 %34, %36
%38 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i64 0, i32 1
store i64 %37, i64* %38
%39 = load i32, i32* %30
%40 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%41 = load i32, i32* %40
%42 = sub nsw i32 %39, %41
%43 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i64 0, i32 0
store i32 %42, i32* %43
%44 = icmp slt i32 %42, 0
br i1 %44, label %45, label %48
45: ; preds = %20
%46 = add nsw i32 %42, 1000000
store i32 %46, i32* %43
%47 = add nsw i64 %37, -1
store i64 %47, i64* %38
br label %48
48: ; preds = %45, %20
%49 = call %struct.tm* @gmtime(i64* %38)
%50 = getelementptr inbounds %struct.tm, %struct.tm* %49, i64 0, i32 0
%51 = load i32, i32* %50
%52 = getelementptr inbounds %struct.tm, %struct.tm* %49, i64 0, i32 1
%53 = load i32, i32* %52
%54 = getelementptr inbounds %struct.tm, %struct.tm* %49, i64 0, i32 2
%55 = load i32, i32* %54
%56 = load i32, i32* %43
%57 = sdiv i32 %56, 1000
%58 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %51, i32 %53, i32 %55, i32 %57, i32 %5)
%59 = icmp slt i32 %4, 0
br i1 %59, label %60, label %62
60: ; preds = %48
%61 = call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i64 10, i64 1, i32* %21)
br label %64
62: ; preds = %48
%63 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %4)
br label %64
64: ; preds = %62, %60
%65 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* %6)
%66 = icmp sgt i32 %7, 0
br i1 %66, label %67, label %79
67: ; preds = %64
%68 = zext i32 %7 to i64
%69 = zext i32 %7 to i64
br label %70
70: ; preds = %67, %70
%71 = phi i64 [ 0, %67 ], [ %74, %70 ]
%72 = getelementptr inbounds i8*, i8** %8, i64 %71
%73 = load i8*, i8** %72
%74 = add nuw nsw i64 %71, 1
%75 = icmp ult i64 %74, %68
%76 = select i1 %75, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.9, i64 0, i64 0)
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %73, i8* %76)
%78 = icmp eq i64 %74, %69
br i1 %78, label %79, label %70
79: ; preds = %70, %64
%80 = icmp eq i32 %5, 0
%81 = icmp sgt i32 %4, -1
%82 = and i1 %81, %80
br i1 %82, label %83, label %85
83: ; preds = %79
%84 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i64 2, i64 1, i32* %21)
br label %87
85: ; preds = %79
%86 = call i32 @fputc(i32 10, i32* %21)
br label %87
87: ; preds = %85, %83
%88 = load i32*, i32** @stdout
%89 = icmp eq i32* %21, %88
br i1 %89, label %92, label %90
90: ; preds = %87
%91 = call i32 @fclose(i32* %21)
br label %92
92: ; preds = %90, %87
ret void
}