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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fstat(int /*<<< orphan*/, struct stat *);
struct tm *gmtime(int *);
int /*<<< orphan*/ printf(char *, char *, int, char *, char *);
int /*<<< orphan*/ rename(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, ...);
scalar_t__ stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
void main(int argc, char **argv) {
  FILE *jpgfile;
  time_t time;
  struct tm *temptm;
  unsigned char buffer[4];
  char timestring[200];
  char tempstring[300];
  char newname[300];
  int i;
  struct stat statbuf;
  struct stat statbuf2;
  int newnamecounter;
  if (argc < 2) {
    fprintf(stderr, "Usage: renamejpg [filename(s)]\n\n");
    exit(1);
  }
  for (i = 1; i < argc; i++) {
    if ((jpgfile = fopen(argv[i], "rb")) == NULL) {
      fprintf(stderr, "File could not be opened. Aborted.\n\n");
      exit(2);
    }
    fseek(jpgfile, 0x32, SEEK_SET);
    fread(buffer, 1, 4, jpgfile);
    time = (((time_t)buffer[0])) | (((time_t)buffer[1]) << 8) |
           (((time_t)buffer[2]) << 16) | (((time_t)buffer[3]) << 24);
    temptm = gmtime(&time);
    strftime(timestring, 200, "%Y%m%d-%H%M%S", temptm);
    fstat(fileno(jpgfile), &statbuf);
    if (statbuf.st_size < 4000)
      snprintf(tempstring, 200, "thm_%s", timestring);
    else
      snprintf(tempstring, 200, "aut_%s", timestring);
    snprintf(newname, 200, "%s.jpg", tempstring);
    newnamecounter = 1;
    while (stat(newname, &statbuf2) == 0) {
      newnamecounter++;
      snprintf(newname, 200, "%s-%d.jpg", tempstring, newnamecounter);
    }
    printf("File %s, size %ld, %s -> %s\n", argv[i], statbuf.st_size,
           timestring, newname);
    fclose(jpgfile);
    rename(argv[i], newname);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x380,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    121b <main+0x3b>
mov    0x2ddd(%rip),%rax
mov    (%rax),%edi
lea    0xdf4(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>
movl   $0x1,-0x364(%rbp)
mov    -0x364(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    144e <main+0x26e>
mov    -0x10(%rbp),%rax
movslq -0x364(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdd7(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    127c <main+0x9c>
mov    0x2d7c(%rip),%rax
mov    (%rax),%edi
lea    0xdb7(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x2,%edi
call   10f0 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    0x2d51(%rip),%rax
mov    (%rax),%edx
mov    $0x32,%esi
call   10a0 <fseek@plt>
lea    -0x2c(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
movzbl -0x2c(%rbp),%eax
movzbl -0x2b(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x2a(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x29(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
call   10e0 <gmtime@plt>
mov    %rax,-0x28(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0xc8,%esi
lea    0xd59(%rip),%rdx
call   10b0 <strftime@plt>
mov    -0x18(%rbp),%rdi
call   1090 <fileno@plt>
mov    %eax,%edi
lea    -0x368(%rbp),%rsi
call   1100 <fstat@plt>
cmpl   $0xfa0,-0x368(%rbp)
jge    1342 <main+0x162>
lea    -0x230(%rbp),%rdi
lea    -0x100(%rbp),%rcx
mov    $0xc8,%esi
lea    0xd21(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
jmp    1363 <main+0x183>
lea    -0x230(%rbp),%rdi
lea    -0x100(%rbp),%rcx
mov    $0xc8,%esi
lea    0xd02(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
lea    -0x360(%rbp),%rdi
lea    -0x230(%rbp),%rcx
mov    $0xc8,%esi
lea    0xce8(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
movl   $0x1,-0x374(%rbp)
lea    -0x360(%rbp),%rdi
lea    -0x370(%rbp),%rsi
call   1080 <stat@plt>
cmp    $0x0,%rax
jne    13e7 <main+0x207>
mov    -0x374(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x374(%rbp)
lea    -0x360(%rbp),%rdi
lea    -0x230(%rbp),%rcx
mov    -0x374(%rbp),%r8d
mov    $0xc8,%esi
lea    0xc91(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
jmp    138e <main+0x1ae>
mov    -0x10(%rbp),%rax
movslq -0x364(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x368(%rbp),%edx
lea    -0x100(%rbp),%rcx
lea    -0x360(%rbp),%r8
lea    0xc65(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
movslq -0x364(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x360(%rbp),%rsi
call   10d0 <rename@plt>
mov    -0x364(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x364(%rbp)
jmp    1225 <main+0x45>
add    $0x380,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x378,%rsp
cmp    $0x2,%edi
jl     13e1 <main+0x201>
mov    %rsi,%rbx
mov    %edi,%eax
mov    %rax,0x18(%rsp)
mov    $0x1,%ebp
lea    0x240(%rsp),%r12
lea    0x110(%rsp),%r13
lea    0x38(%rsp),%r14
mov    %rsi,0x20(%rsp)
jmp    127e <main+0x9e>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x20(%rsp),%rbx
mov    0x30(%rsp),%rbp
mov    (%rbx,%rbp,8),%rsi
lea    0xe31(%rip),%rdi
mov    0xc(%rsp),%edx
lea    0x40(%rsp),%rcx
mov    %r13,%r8
call   1050 <printf@plt>
mov    0x28(%rsp),%rdi
call   1040 <fclose@plt>
mov    (%rbx,%rbp,8),%rdi
mov    %r13,%rsi
call   10d0 <rename@plt>
add    $0x1,%rbp
cmp    0x18(%rsp),%rbp
mov    %r15,%r14
je     13b0 <main+0x1d0>
mov    %rbp,0x30(%rsp)
mov    (%rbx,%rbp,8),%rdi
lea    0xd93(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     13c2 <main+0x1e2>
mov    %rax,%rbp
mov    0x2d32(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
mov    $0x32,%esi
call   10a0 <fseek@plt>
lea    0x14(%rsp),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %rbp,%rcx
call   1030 <fread@plt>
mov    0x14(%rsp),%eax
mov    %eax,0x10(%rsp)
lea    0x10(%rsp),%rdi
call   10e0 <gmtime@plt>
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
lea    0xd57(%rip),%rdx
mov    %rax,%rcx
call   10b0 <strftime@plt>
mov    %rbp,0x28(%rsp)
mov    %rbp,%rdi
call   1090 <fileno@plt>
mov    %eax,%edi
lea    0x8(%rsp),%rsi
call   1100 <fstat@plt>
mov    0x8(%rsp),%eax
mov    %eax,0xc(%rsp)
cmp    $0xfa0,%eax
lea    0xd37(%rip),%rdx
lea    0xd29(%rip),%rax
cmovl  %rax,%rdx
mov    %r12,%rdi
mov    $0xc8,%esi
mov    %rbx,%rcx
xor    %eax,%eax
call   1060 <snprintf@plt>
mov    %r13,%rdi
mov    $0xc8,%esi
lea    0xd12(%rip),%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1060 <snprintf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1080 <stat@plt>
test   %rax,%rax
mov    %r14,%r15
lea    0xcf7(%rip),%r14
jne    1230 <main+0x50>
mov    $0x2,%ebx
mov    %r13,%rdi
mov    $0xc8,%esi
mov    %r14,%rdx
mov    %r12,%rcx
mov    %ebx,%r8d
xor    %eax,%eax
call   1060 <snprintf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1080 <stat@plt>
add    $0x1,%ebx
test   %rax,%rax
je     1380 <main+0x1a0>
jmp    1230 <main+0x50>
add    $0x378,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c17(%rip),%rax
mov    (%rax),%edi
lea    0xc52(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x2,%edi
call   10f0 <exit@plt>
mov    0x2bf8(%rip),%rax
mov    (%rax),%edi
lea    0xc0f(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [33 x i8] c"Usage: renamejpg [filename(s)]\0A\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [37 x i8] c"File could not be opened. Aborted.\0A\0A\00"
@SEEK_SET = global i32 0
@.str.3 = [14 x i8] c"%Y%m%d-%H%M%S\00"
@.str.4 = [7 x i8] c"thm_%s\00"
@.str.5 = [7 x i8] c"aut_%s\00"
@.str.6 = [7 x i8] c"%s.jpg\00"
@.str.7 = [10 x i8] c"%s-%d.jpg\00"
@.str.8 = [29 x i8] c"File %s, size %ld, %s -> %s\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32
%7 = alloca %struct.tm*
%8 = alloca [4 x i8]
%9 = alloca [200 x i8]
%10 = alloca [300 x i8]
%11 = alloca [300 x i8]
%12 = alloca i32
%13 = alloca %struct.stat
%14 = alloca %struct.stat
%15 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 2
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %2
store i32 1, i32* %12
br label %23
23: ; preds = %117, %22
%24 = load i32, i32* %12
%25 = load i32, i32* %3
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %120
27: ; preds = %23
%28 = load i8**, i8*** %4
%29 = load i32, i32* %12
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8*, i8** %28, i64 %30
%32 = load i8*, i8** %31
%33 = call i32* @fopen(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %33, i32** %5
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %39
35: ; preds = %27
%36 = load i32, i32* @stderr
%37 = call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%38 = call i32 @exit(i32 2)
unreachable
39: ; preds = %27
%40 = load i32*, i32** %5
%41 = load i32, i32* @SEEK_SET
%42 = call i32 @fseek(i32* %40, i32 50, i32 %41)
%43 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%44 = load i32*, i32** %5
%45 = call i32 @fread(i8* %43, i32 1, i32 4, i32* %44)
%46 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 1
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = shl i32 %51, 8
%53 = or i32 %48, %52
%54 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 2
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = shl i32 %56, 16
%58 = or i32 %53, %57
%59 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 3
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = shl i32 %61, 24
%63 = or i32 %58, %62
store i32 %63, i32* %6
%64 = call %struct.tm* @gmtime(i32* %6)
store %struct.tm* %64, %struct.tm** %7
%65 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 0
%66 = load %struct.tm*, %struct.tm** %7
%67 = call i32 @strftime(i8* %65, i32 200, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %struct.tm* %66)
%68 = load i32*, i32** %5
%69 = call i32 @fileno(i32* %68)
%70 = call i32 @fstat(i32 %69, %struct.stat* %13)
%71 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%72 = load i32, i32* %71
%73 = icmp slt i32 %72, 4000
br i1 %73, label %74, label %78
74: ; preds = %39
%75 = getelementptr inbounds [300 x i8], [300 x i8]* %10, i64 0, i64 0
%76 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 0
%77 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %75, i32 200, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %76)
br label %82
78: ; preds = %39
%79 = getelementptr inbounds [300 x i8], [300 x i8]* %10, i64 0, i64 0
%80 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 0
%81 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %79, i32 200, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %80)
br label %82
82: ; preds = %78, %74
%83 = getelementptr inbounds [300 x i8], [300 x i8]* %11, i64 0, i64 0
%84 = getelementptr inbounds [300 x i8], [300 x i8]* %10, i64 0, i64 0
%85 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %83, i32 200, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %84)
store i32 1, i32* %15
br label %86
86: ; preds = %90, %82
%87 = getelementptr inbounds [300 x i8], [300 x i8]* %11, i64 0, i64 0
%88 = call i64 @stat(i8* %87, %struct.stat* %14)
%89 = icmp eq i64 %88, 0
br i1 %89, label %90, label %97
90: ; preds = %86
%91 = load i32, i32* %15
%92 = add nsw i32 %91, 1
store i32 %92, i32* %15
%93 = getelementptr inbounds [300 x i8], [300 x i8]* %11, i64 0, i64 0
%94 = getelementptr inbounds [300 x i8], [300 x i8]* %10, i64 0, i64 0
%95 = load i32, i32* %15
%96 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %93, i32 200, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %94, i32 %95)
br label %86
97: ; preds = %86
%98 = load i8**, i8*** %4
%99 = load i32, i32* %12
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8*, i8** %98, i64 %100
%102 = load i8*, i8** %101
%103 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%104 = load i32, i32* %103
%105 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 0
%106 = getelementptr inbounds [300 x i8], [300 x i8]* %11, i64 0, i64 0
%107 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i8* %102, i32 %104, i8* %105, i8* %106)
%108 = load i32*, i32** %5
%109 = call i32 @fclose(i32* %108)
%110 = load i8**, i8*** %4
%111 = load i32, i32* %12
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8*, i8** %110, i64 %112
%114 = load i8*, i8** %113
%115 = getelementptr inbounds [300 x i8], [300 x i8]* %11, i64 0, i64 0
%116 = call i32 @rename(i8* %114, i8* %115)
br label %117
117: ; preds = %97
%118 = load i32, i32* %12
%119 = add nsw i32 %118, 1
store i32 %119, i32* %12
br label %23
120: ; preds = %23
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.tm = type { i32 }
@stderr = global i32 0
@.str = [33 x i8] c"Usage: renamejpg [filename(s)]\0A\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [37 x i8] c"File could not be opened. Aborted.\0A\0A\00"
@SEEK_SET = global i32 0
@.str.3 = [14 x i8] c"%Y%m%d-%H%M%S\00"
@.str.4 = [7 x i8] c"thm_%s\00"
@.str.5 = [7 x i8] c"aut_%s\00"
@.str.6 = [7 x i8] c"%s.jpg\00"
@.str.7 = [10 x i8] c"%s-%d.jpg\00"
@.str.8 = [29 x i8] c"File %s, size %ld, %s -> %s\0A\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [4 x i8]
%5 = alloca [200 x i8]
%6 = alloca [300 x i8]
%7 = alloca [300 x i8]
%8 = alloca %struct.stat
%9 = alloca %struct.stat
%10 = bitcast i32* %3 to i8*
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%12 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%13 = getelementptr inbounds [300 x i8], [300 x i8]* %6, i64 0, i64 0
%14 = getelementptr inbounds [300 x i8], [300 x i8]* %7, i64 0, i64 0
%15 = bitcast %struct.stat* %8 to i8*
%16 = bitcast %struct.stat* %9 to i8*
%17 = icmp slt i32 %0, 2
br i1 %17, label %24, label %18
18: ; preds = %2
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
%22 = getelementptr inbounds %struct.stat, %struct.stat* %8, i64 0, i32 0
%23 = zext i32 %0 to i64
br label %28
24: ; preds = %2
%25 = load i32, i32* @stderr
%26 = tail call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%27 = tail call i32 @exit(i32 1)
unreachable
28: ; preds = %18, %73
%29 = phi i64 [ 1, %18 ], [ %79, %73 ]
%30 = getelementptr inbounds i8*, i8** %1, i64 %29
%31 = load i8*, i8** %30
%32 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %38
34: ; preds = %28
%35 = load i32, i32* @stderr
%36 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%37 = call i32 @exit(i32 2)
unreachable
38: ; preds = %28
%39 = load i32, i32* @SEEK_SET
%40 = call i32 @fseek(i32* %32, i32 50, i32 %39)
%41 = call i32 @fread(i8* %11, i32 1, i32 4, i32* %32)
%42 = load i8, i8* %11
%43 = zext i8 %42 to i32
%44 = load i8, i8* %19
%45 = zext i8 %44 to i32
%46 = shl nuw nsw i32 %45, 8
%47 = or i32 %46, %43
%48 = load i8, i8* %20
%49 = zext i8 %48 to i32
%50 = shl nuw nsw i32 %49, 16
%51 = or i32 %47, %50
%52 = load i8, i8* %21
%53 = zext i8 %52 to i32
%54 = shl nuw i32 %53, 24
%55 = or i32 %51, %54
store i32 %55, i32* %3
%56 = call %struct.tm* @gmtime(i32* %3)
%57 = call i32 @strftime(i8* %12, i32 200, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %struct.tm* %56)
%58 = call i32 @fileno(i32* %32)
%59 = call i32 @fstat(i32 %58, %struct.stat* %8)
%60 = load i32, i32* %22
%61 = icmp slt i32 %60, 4000
%62 = select i1 %61, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%63 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %13, i32 200, i8* %62, i8* %12)
%64 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %14, i32 200, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %13)
%65 = call i64 @stat(i8* %14, %struct.stat* %9)
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %73
67: ; preds = %38, %67
%68 = phi i32 [ %69, %67 ], [ 1, %38 ]
%69 = add nuw nsw i32 %68, 1
%70 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %14, i32 200, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %13, i32 %69)
%71 = call i64 @stat(i8* %14, %struct.stat* %9)
%72 = icmp eq i64 %71, 0
br i1 %72, label %67, label %73
73: ; preds = %67, %38
%74 = load i8*, i8** %30
%75 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i8* %74, i32 %60, i8* %12, i8* %14)
%76 = call i32 @fclose(i32* %32)
%77 = load i8*, i8** %30
%78 = call i32 @rename(i8* %77, i8* %14)
%79 = add nuw nsw i64 %29, 1
%80 = icmp eq i64 %79, %23
br i1 %80, label %81, label %28
81: ; preds = %73
ret void
}