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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
scalar_t__ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  FILE *fp;
  fp = fopen("out.log", "a+");
  time_t now = time(NULL);
  fprintf(fp, "%ju\t", (uintmax_t)now);
  int i;
  for (i = 1; i < argc; i++) {
    fprintf(fp, "%s\t", argv[i]);
  }
  fprintf(fp, "\n");
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
lea    0xea4(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %eax,%edx
lea    0xe80(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d1 <main+0x91>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe54(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1199 <main+0x59>
mov    -0x18(%rbp),%rdi
lea    0xe38(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xe9c(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%r12
xor    %edi,%edi
call   1060 <time@plt>
lea    0xe8a(%rip),%rsi
mov    %r12,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
cmp    $0x2,%ebp
jl     11ba <main+0x6a>
mov    %ebp,%ebp
mov    $0x1,%ebx
lea    0xe70(%rip),%r15
mov    (%r14,%rbx,8),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11a0 <main+0x50>
mov    $0xa,%edi
mov    %r12,%rsi
call   1040 <fputc@plt>
mov    %r12,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"out.log\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [5 x i8] c"%ju\09\00"
@.str.3 = [4 x i8] c"%s\09\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %9, i32** %6
%10 = call i64 @time(i32* null)
store i64 %10, i64* %7
%11 = load i32*, i32** %6
%12 = load i64, i64* %7
%13 = trunc i64 %12 to i32
%14 = call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %13)
store i32 1, i32* %8
br label %15
15: ; preds = %27, %2
%16 = load i32, i32* %8
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %30
19: ; preds = %15
%20 = load i32*, i32** %6
%21 = load i8**, i8*** %5
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %25)
br label %27
27: ; preds = %19
%28 = load i32, i32* %8
%29 = add nsw i32 %28, 1
store i32 %29, i32* %8
br label %15
30: ; preds = %15
%31 = load i32*, i32** %6
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%33 = load i32*, i32** %6
%34 = call i32 @fclose(i32* %33)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"out.log\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [5 x i8] c"%ju\09\00"
@.str.3 = [4 x i8] c"%s\09\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i64 @time(i32* null)
%5 = trunc i64 %4 to i32
%6 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = zext i32 %0 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 1, %8 ], [ %15, %10 ]
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %13)
%15 = add nuw nsw i64 %11, 1
%16 = icmp eq i64 %15, %9
br i1 %16, label %17, label %10
17: ; preds = %10, %2
%18 = tail call i32 @fputc(i32 10, i32* %3)
%19 = tail call i32 @fclose(i32* %3)
ret i32 0
}