#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;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  int num, length, width;
  FILE *fp;
  time_t timer;
  char buffer1[32], buffer2[32], buffer3[32];
  struct tm *tm_info;
  time(&timer);
  tm_info = localtime(&timer);
  strftime(buffer1, 32, "%Y-%m-%dT%H:%M:%S%z", tm_info);
  strftime(buffer2, 32, "%s", tm_info);
  strftime(buffer3, 32, "00_%s.txt", tm_info);
  fp = fopen(buffer3, "w");
  fprintf(fp, "####################################\n");
  fprintf(fp, "#\n");
  fprintf(fp, "# -- TEXTPATGEN GENERATED FILE --\n");
  fprintf(fp, "#\n");
  fprintf(fp, "# -- Created: %s\n", buffer1);
  fprintf(fp, "# -- Epoch Time: %s\n", buffer2);
  fprintf(fp, "#\n");
  fprintf(fp, "####################################\n");
  num = 0;
  for (length = 0; length < 10; length++) {
    for (width = 0; width < 9; width++) {
      fprintf(fp, "D-%04d ", num);
      num++;
    }
    fprintf(fp, "D-%04d\n", num);
    num++;
  }
  fprintf(fp, "# -- End of file.\n");
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x2c(%rbp),%rdi
call   1060 <time@plt>
lea    -0x2c(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x98(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x98(%rbp),%rcx
mov    $0x20,%esi
lea    0xe57(%rip),%rdx
call   1070 <strftime@plt>
lea    -0x70(%rbp),%rdi
mov    -0x98(%rbp),%rcx
mov    $0x20,%esi
lea    0xe4f(%rip),%rdx
call   1070 <strftime@plt>
lea    -0x90(%rbp),%rdi
mov    -0x98(%rbp),%rcx
mov    $0x20,%esi
lea    0xe33(%rip),%rdx
call   1070 <strftime@plt>
lea    -0x90(%rbp),%rdi
lea    0xe2a(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe18(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe29(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe1a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xe05(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    0xe15(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0xe11(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xdc7(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xd92(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    1319 <main+0x1b9>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x9,-0x1c(%rbp)
jge    12ed <main+0x18d>
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xdc4(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12b7 <main+0x157>
mov    -0x28(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xda0(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12a6 <main+0x146>
mov    -0x28(%rbp),%rdi
lea    0xd7f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x70,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    %rax,%rbx
lea    0xe64(%rip),%rdx
lea    0x50(%rsp),%r14
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rax,%rcx
call   1070 <strftime@plt>
lea    0xe5c(%rip),%rdx
lea    0x30(%rsp),%r15
mov    %r15,%rdi
mov    $0x20,%esi
mov    %rbx,%rcx
call   1070 <strftime@plt>
lea    0xe43(%rip),%rdx
lea    0x10(%rsp),%r12
mov    %r12,%rdi
mov    $0x20,%esi
mov    %rbx,%rcx
call   1070 <strftime@plt>
lea    0xe31(%rip),%rsi
mov    %r12,%rdi
call   1080 <fopen@plt>
mov    %rax,%r12
lea    0xe21(%rip),%r13
mov    $0x25,%esi
mov    $0x1,%edx
mov    %r13,%rdi
mov    %rax,%rcx
call   1090 <fwrite@plt>
lea    0xe28(%rip),%rbx
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r12,%rcx
call   1090 <fwrite@plt>
lea    0xe0f(%rip),%rdi
mov    $0x22,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1090 <fwrite@plt>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r12,%rcx
call   1090 <fwrite@plt>
lea    0xe04(%rip),%rsi
mov    %r12,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xe02(%rip),%rsi
mov    %r12,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r12,%rcx
call   1090 <fwrite@plt>
mov    $0x25,%esi
mov    $0x1,%edx
mov    %r13,%rdi
mov    %r12,%rcx
call   1090 <fwrite@plt>
lea    0xdd9(%rip),%r14
lea    0xdda(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x1(%rbx),%edx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x2(%rbx),%edx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x3(%rbx),%edx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x4(%rbx),%edx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x5(%rbx),%edx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x6(%rbx),%edx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x7(%rbx),%edx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x8(%rbx),%edx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x9(%rbx),%edx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xa(%rbx),%eax
cmp    $0x5a,%ebx
mov    %eax,%ebx
jne    12d0 <main+0x160>
lea    0xd1f(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1090 <fwrite@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [20 x i8] c"%Y-%m-%dT%H:%M:%S%z\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [10 x i8] c"00_%s.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [38 x i8] c"####################################\0A\00"
@.str.5 = [3 x i8] c"#\0A\00"
@.str.6 = [35 x i8] c"# -- TEXTPATGEN GENERATED FILE --\0A\00"
@.str.7 = [18 x i8] c"# -- Created: %s\0A\00"
@.str.8 = [21 x i8] c"# -- Epoch Time: %s\0A\00"
@.str.9 = [8 x i8] c"D-%04d \00"
@.str.10 = [8 x i8] c"D-%04d\0A\00"
@.str.11 = [19 x i8] c"# -- End of file.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca [32 x i8]
%12 = alloca [32 x i8]
%13 = alloca [32 x i8]
%14 = alloca %struct.tm*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = call i32 @time(i32* %10)
%16 = call %struct.tm* @localtime(i32* %10)
store %struct.tm* %16, %struct.tm** %14
%17 = getelementptr inbounds [32 x i8], [32 x i8]* %11, i64 0, i64 0
%18 = load %struct.tm*, %struct.tm** %14
%19 = call i32 @strftime(i8* %17, i32 32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %struct.tm* %18)
%20 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 0
%21 = load %struct.tm*, %struct.tm** %14
%22 = call i32 @strftime(i8* %20, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %21)
%23 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%24 = load %struct.tm*, %struct.tm** %14
%25 = call i32 @strftime(i8* %23, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %struct.tm* %24)
%26 = getelementptr inbounds [32 x i8], [32 x i8]* %13, i64 0, i64 0
%27 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %27, i32** %9
%28 = load i32*, i32** %9
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%30 = load i32*, i32** %9
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%32 = load i32*, i32** %9
%33 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0))
%34 = load i32*, i32** %9
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%36 = load i32*, i32** %9
%37 = getelementptr inbounds [32 x i8], [32 x i8]* %11, i64 0, i64 0
%38 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i8* %37)
%39 = load i32*, i32** %9
%40 = getelementptr inbounds [32 x i8], [32 x i8]* %12, i64 0, i64 0
%41 = call i32 (i32*, i8*, ...) @fprintf(i32* %39, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %40)
%42 = load i32*, i32** %9
%43 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%44 = load i32*, i32** %9
%45 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %6
store i32 0, i32* %7
br label %46
46: ; preds = %68, %2
%47 = load i32, i32* %7
%48 = icmp slt i32 %47, 10
br i1 %48, label %49, label %71
49: ; preds = %46
store i32 0, i32* %8
br label %50
50: ; preds = %59, %49
%51 = load i32, i32* %8
%52 = icmp slt i32 %51, 9
br i1 %52, label %53, label %62
53: ; preds = %50
%54 = load i32*, i32** %9
%55 = load i32, i32* %6
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %54, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %55)
%57 = load i32, i32* %6
%58 = add nsw i32 %57, 1
store i32 %58, i32* %6
br label %59
59: ; preds = %53
%60 = load i32, i32* %8
%61 = add nsw i32 %60, 1
store i32 %61, i32* %8
br label %50
62: ; preds = %50
%63 = load i32*, i32** %9
%64 = load i32, i32* %6
%65 = call i32 (i32*, i8*, ...) @fprintf(i32* %63, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %64)
%66 = load i32, i32* %6
%67 = add nsw i32 %66, 1
store i32 %67, i32* %6
br label %68
68: ; preds = %62
%69 = load i32, i32* %7
%70 = add nsw i32 %69, 1
store i32 %70, i32* %7
br label %46
71: ; preds = %46
%72 = load i32*, i32** %9
%73 = call i32 (i32*, i8*, ...) @fprintf(i32* %72, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0))
%74 = load i32*, i32** %9
%75 = call i32 @fclose(i32* %74)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [20 x i8] c"%Y-%m-%dT%H:%M:%S%z\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [10 x i8] c"00_%s.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [38 x i8] c"####################################\0A\00"
@.str.5 = [3 x i8] c"#\0A\00"
@.str.6 = [35 x i8] c"# -- TEXTPATGEN GENERATED FILE --\0A\00"
@.str.7 = [18 x i8] c"# -- Created: %s\0A\00"
@.str.8 = [21 x i8] c"# -- Epoch Time: %s\0A\00"
@.str.9 = [8 x i8] c"D-%04d \00"
@.str.10 = [8 x i8] c"D-%04d\0A\00"
@.str.11 = [19 x i8] c"# -- End of file.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [32 x i8]
%5 = alloca [32 x i8]
%6 = alloca [32 x i8]
%7 = bitcast i32* %3 to i8*
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
%11 = call i32 @time(i32* %3)
%12 = call %struct.tm* @localtime(i32* %3)
%13 = call i32 @strftime(i8* %8, i32 32, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %struct.tm* %12)
%14 = call i32 @strftime(i8* %9, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %12)
%15 = call i32 @strftime(i8* %10, i32 32, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %struct.tm* %12)
%16 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%17 = call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i64 37, i64 1, i32* %16)
%18 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i64 2, i64 1, i32* %16)
%19 = call i64 @fwrite(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i64 34, i64 1, i32* %16)
%20 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i64 2, i64 1, i32* %16)
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i8* %8)
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %9)
%23 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i64 2, i64 1, i32* %16)
%24 = call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i64 37, i64 1, i32* %16)
br label %25
25: ; preds = %2, %25
%26 = phi i32 [ 0, %2 ], [ %47, %25 ]
%27 = phi i32 [ 0, %2 ], [ %48, %25 ]
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %26)
%29 = or i32 %26, 1
%30 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %29)
%31 = add nuw nsw i32 %26, 2
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %31)
%33 = add nuw nsw i32 %26, 3
%34 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %33)
%35 = add nuw nsw i32 %26, 4
%36 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %35)
%37 = add nuw nsw i32 %26, 5
%38 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %37)
%39 = add nuw nsw i32 %26, 6
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %39)
%41 = add nuw nsw i32 %26, 7
%42 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %41)
%43 = add nuw nsw i32 %26, 8
%44 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 %43)
%45 = add nuw nsw i32 %26, 9
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %45)
%47 = add nuw nsw i32 %26, 10
%48 = add nuw nsw i32 %27, 1
%49 = icmp eq i32 %48, 10
br i1 %49, label %50, label %25
50: ; preds = %25
%51 = call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i64 18, i64 1, i32* %16)
%52 = call i32 @fclose(i32* %16)
ret i32 0
}