#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*/ version;
typedef int /*<<< orphan*/ rawReleaseDate;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ *openFile(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
char *strchr(char *, char);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  char *versionFile = "../VERSION";
  char *releaseDateFile = "../RELEASE-DATE";
  char version[128];
  char rawReleaseDate[128];
  char tiffLibVersion[128];
  FILE *fd;
  char *cp;
  argc--, argv++;
  while (argc > 0 && argv[0][0] == '-') {
    if (strcmp(argv[0], "-v") == 0) {
      if (argc < 1)
        usage();
      argc--, argv++;
      versionFile = argv[0];
    } else if (strcmp(argv[0], "-r") == 0) {
      if (argc < 1)
        usage();
      argc--, argv++;
      releaseDateFile = argv[0];
    } else
      usage();
    argc--, argv++;
  }
  fd = openFile(versionFile);
  if (fgets(version, sizeof(version) - 1, fd) == NULL) {
    fprintf(stderr, "mkversion: No version information in %s.\n", versionFile);
    exit(-1);
  }
  cp = strchr(version, '\n');
  if (cp)
    *cp = '\0';
  fclose(fd);
  fd = openFile(releaseDateFile);
  if (fgets(rawReleaseDate, sizeof(rawReleaseDate) - 1, fd) == NULL) {
    fprintf(stderr, "mkversion: No release date information in %s.\n",
            releaseDateFile);
    exit(-1);
  }
  fclose(fd);
  sprintf(tiffLibVersion, "#define TIFFLIB_VERSION %4.4s%2.2s%2.2s",
          rawReleaseDate + 6, rawReleaseDate + 0, rawReleaseDate + 3);
  if (argc > 0) {
    fd = fopen(argv[0], "w");
    if (fd == NULL) {
      fprintf(stderr, "mkversion: %s: Could not open for writing.\n", argv[0]);
      exit(-1);
    }
  } else
    fd = stdout;
  fprintf(fd, "#define TIFFLIB_VERSION_STR \"LIBTIFF, Version %s\\n", version);
  fprintf(fd, "Copyright (c) 1988-1996 Sam Leffler\\n");
  fprintf(fd, "Copyright (c) 1991-1996 Silicon Graphics, Inc.\"\n");
  fprintf(fd, "/*\n"
              " * This define can be used in code that requires\n"
              " * compilation-related definitions specific to a\n"
              " * version or versions of the library.  Runtime\n"
              " * version checking should be done based on the\n"
              " * string returned by TIFFGetVersion.\n"
              " */\n");
  fprintf(fd, "%s\n", tiffLibVersion);
  if (fd != stdout)
    fclose(fd);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe40(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe40(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x1b1(%rbp)
jle    120c <main+0x6c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x1b1(%rbp)
mov    -0x1b1(%rbp),%al
test   $0x1,%al
jne    121f <main+0x7f>
jmp    12eb <main+0x14b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdee(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1272 <main+0xd2>
cmpl   $0x1,-0x8(%rbp)
jge    124d <main+0xad>
mov    $0x0,%al
call   1090 <usage@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    12d1 <main+0x131>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd9e(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12c5 <main+0x125>
cmpl   $0x1,-0x8(%rbp)
jge    12a0 <main+0x100>
mov    $0x0,%al
call   1090 <usage@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    12cc <main+0x12c>
mov    $0x0,%al
call   1090 <usage@plt>
jmp    12d1 <main+0x131>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    11e4 <main+0x44>
mov    -0x18(%rbp),%rdi
call   1040 <openFile@plt>
mov    %rax,-0x1a8(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x1a8(%rbp),%rdx
mov    $0x7f,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    1343 <main+0x1a3>
mov    0x2cbc(%rip),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rdx
lea    0xcef(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
lea    -0xa0(%rbp),%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,-0x1b0(%rbp)
cmpq   $0x0,-0x1b0(%rbp)
je     1373 <main+0x1d3>
mov    -0x1b0(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x1a8(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <openFile@plt>
mov    %rax,-0x1a8(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x1a8(%rbp),%rdx
mov    $0x7f,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    13d7 <main+0x237>
mov    0x2c28(%rip),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rdx
lea    0xc85(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
mov    -0x1a8(%rbp),%rdi
call   1030 <fclose@plt>
lea    -0x1a0(%rbp),%rdi
lea    -0x120(%rbp),%rdx
add    $0x6,%rdx
lea    -0x120(%rbp),%rcx
lea    -0x120(%rbp),%r8
add    $0x3,%r8
lea    0xc6c(%rip),%rsi
call   10b0 <sprintf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1473 <main+0x2d3>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xc77(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x1a8(%rbp)
cmpq   $0x0,-0x1a8(%rbp)
jne    146e <main+0x2ce>
mov    0x2b94(%rip),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xc47(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
jmp    1484 <main+0x2e4>
mov    0x2b5e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x1a8(%rbp)
mov    -0x1a8(%rbp),%rdi
lea    -0xa0(%rbp),%rdx
lea    0xc37(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x1a8(%rbp),%rdi
lea    0xc55(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x1a8(%rbp),%rdi
lea    0xc66(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x1a8(%rbp),%rdi
lea    0xc82(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x1a8(%rbp),%rdi
lea    -0x1a0(%rbp),%rdx
lea    0xd56(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x1a8(%rbp),%rax
mov    0x2acf(%rip),%rcx
cmp    (%rcx),%rax
je     151e <main+0x37e>
mov    -0x1a8(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
lea    0x8(%rsi),%r14
cmp    $0x2,%edi
jl     1260 <main+0xb0>
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe26(%rip),%r15
lea    0xe2a(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xe2e(%rip),%r13
jmp    1206 <main+0x56>
nop
add    $0xffffffff,%ebp
xor    %eax,%eax
call   1090 <usage@plt>
mov    %r14,%rbx
add    $0x8,%r14
cmp    $0x1,%ebp
jle    1273 <main+0xc3>
mov    0x8(%rbx),%rdi
movzbl (%rdi),%r12d
cmp    $0x2d,%r12b
jne    1273 <main+0xc3>
mov    %r13,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1250 <main+0xa0>
mov    (%r14),%rdi
lea    0xdf3(%rip),%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jne    11f0 <main+0x40>
add    $0xfffffffe,%ebp
mov    0x10(%rbx),%rax
mov    %rax,0x8(%rsp)
jmp    1257 <main+0xa7>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xfffffffe,%ebp
mov    0x10(%rbx),%r15
add    $0x10,%rbx
mov    %rbx,%r14
jmp    11fa <main+0x4a>
lea    0xda4(%rip),%rbp
lea    0xd92(%rip),%r15
xor    %r12d,%r12d
jmp    1280 <main+0xd0>
cmp    $0x2d,%r12b
setne  %r12b
mov    0x8(%rsp),%rbp
mov    %r15,%rdi
call   1040 <openFile@plt>
mov    %rax,%rbx
lea    0x90(%rsp),%rdi
mov    $0x7f,%esi
mov    %rax,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1400 <main+0x250>
lea    0x90(%rsp),%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     12c3 <main+0x113>
movb   $0x0,(%rax)
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %rbp,%rdi
call   1040 <openFile@plt>
mov    %rax,%rbx
lea    0x10(%rsp),%rdi
mov    $0x7f,%esi
mov    %rax,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1416 <main+0x266>
mov    %rbx,%rdi
call   1030 <fclose@plt>
lea    0x16(%rsp),%rdx
lea    0x13(%rsp),%r8
lea    0xd70(%rip),%rsi
lea    0x110(%rsp),%rdi
lea    0x10(%rsp),%rcx
call   10b0 <sprintf@plt>
test   %r12b,%r12b
je     1351 <main+0x1a1>
mov    (%r14),%rdi
lea    0xd77(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    135b <main+0x1ab>
mov    0x2ca1(%rip),%rax
mov    (%rax),%rdi
mov    (%r14),%rdx
lea    0xd58(%rip),%rsi
jmp    142a <main+0x27a>
mov    0x2c80(%rip),%rax
mov    (%rax),%rbx
lea    0xd6e(%rip),%rsi
lea    0x90(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xd88(%rip),%rdi
mov    $0x25,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0xd95(%rip),%rdi
mov    $0x30,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0xdad(%rip),%rdi
mov    $0xef,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0xe84(%rip),%rsi
lea    0x110(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x2bf9(%rip),%rax
cmp    (%rax),%rbx
je     13ec <main+0x23c>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bd9(%rip),%rax
mov    (%rax),%rdi
lea    0xc10(%rip),%rsi
mov    %r15,%rdx
jmp    142a <main+0x27a>
mov    0x2bc3(%rip),%rax
mov    (%rax),%rdi
lea    0xc24(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"../VERSION\00"
@.str.1 = [16 x i8] c"../RELEASE-DATE\00"
@.str.2 = [3 x i8] c"-v\00"
@.str.3 = [3 x i8] c"-r\00"
@stderr = global i32* null
@.str.4 = [42 x i8] c"mkversion: No version information in %s.\0A\00"
@.str.5 = [47 x i8] c"mkversion: No release date information in %s.\0A\00"
@.str.6 = [40 x i8] c"#define TIFFLIB_VERSION %4.4s%2.2s%2.2s\00"
@.str.7 = [2 x i8] c"w\00"
@.str.8 = [44 x i8] c"mkversion: %s: Could not open for writing.\0A\00"
@stdout = global i32* null
@.str.9 = [51 x i8] c"#define TIFFLIB_VERSION_STR \22LIBTIFF, Version %s\\n\00"
@.str.10 = [38 x i8] c"Copyright (c) 1988-1996 Sam Leffler\\n\00"
@.str.11 = [49 x i8] c"Copyright (c) 1991-1996 Silicon Graphics, Inc.\22\0A\00"
@.str.12 = [240 x i8] c"/*\0A * This define can be used in code that requires\0A * compilation-related definitions specific to a\0A * version or versions of the library. Runtime\0A * version checking should be done based on the\0A * string returned by TIFFGetVersion.\0A */\0A\00"
@.str.13 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [128 x i8]
%9 = alloca [128 x i8]
%10 = alloca [128 x i8]
%11 = alloca i32*
%12 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %7
%13 = load i32, i32* %4
%14 = add nsw i32 %13, -1
store i32 %14, i32* %4
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i32 1
store i8** %16, i8*** %5
br label %17
17: ; preds = %71, %2
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %28
20: ; preds = %17
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 45
br label %28
28: ; preds = %20, %17
%29 = phi i1 [ false, %17 ], [ %27, %20 ]
br i1 %29, label %30, label %76
30: ; preds = %28
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 0
%33 = load i8*, i8** %32
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %49
36: ; preds = %30
%37 = load i32, i32* %4
%38 = icmp slt i32 %37, 1
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 (...) @usage()
br label %41
41: ; preds = %39, %36
%42 = load i32, i32* %4
%43 = add nsw i32 %42, -1
store i32 %43, i32* %4
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i32 1
store i8** %45, i8*** %5
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 0
%48 = load i8*, i8** %47
store i8* %48, i8** %6
br label %71
49: ; preds = %30
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 0
%52 = load i8*, i8** %51
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %68
55: ; preds = %49
%56 = load i32, i32* %4
%57 = icmp slt i32 %56, 1
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = call i32 (...) @usage()
br label %60
60: ; preds = %58, %55
%61 = load i32, i32* %4
%62 = add nsw i32 %61, -1
store i32 %62, i32* %4
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i32 1
store i8** %64, i8*** %5
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 0
%67 = load i8*, i8** %66
store i8* %67, i8** %7
br label %70
68: ; preds = %49
%69 = call i32 (...) @usage()
br label %70
70: ; preds = %68, %60
br label %71
71: ; preds = %70, %41
%72 = load i32, i32* %4
%73 = add nsw i32 %72, -1
store i32 %73, i32* %4
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i32 1
store i8** %75, i8*** %5
br label %17
76: ; preds = %28
%77 = load i8*, i8** %6
%78 = call i32* @openFile(i8* %77)
store i32* %78, i32** %11
%79 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%80 = load i32*, i32** %11
%81 = call i32* @fgets(i8* %79, i32 127, i32* %80)
%82 = icmp eq i32* %81, null
br i1 %82, label %83, label %88
83: ; preds = %76
%84 = load i32*, i32** @stderr
%85 = load i8*, i8** %6
%86 = call i32 (i32*, i8*, ...) @fprintf(i32* %84, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i8* %85)
%87 = call i32 @exit(i32 -1)
unreachable
88: ; preds = %76
%89 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%90 = call i8* @strchr(i8* %89, i8 signext 10)
store i8* %90, i8** %12
%91 = load i8*, i8** %12
%92 = icmp ne i8* %91, null
br i1 %92, label %93, label %95
93: ; preds = %88
%94 = load i8*, i8** %12
store i8 0, i8* %94
br label %95
95: ; preds = %93, %88
%96 = load i32*, i32** %11
%97 = call i32 @fclose(i32* %96)
%98 = load i8*, i8** %7
%99 = call i32* @openFile(i8* %98)
store i32* %99, i32** %11
%100 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%101 = load i32*, i32** %11
%102 = call i32* @fgets(i8* %100, i32 127, i32* %101)
%103 = icmp eq i32* %102, null
br i1 %103, label %104, label %109
104: ; preds = %95
%105 = load i32*, i32** @stderr
%106 = load i8*, i8** %7
%107 = call i32 (i32*, i8*, ...) @fprintf(i32* %105, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i8* %106)
%108 = call i32 @exit(i32 -1)
unreachable
109: ; preds = %95
%110 = load i32*, i32** %11
%111 = call i32 @fclose(i32* %110)
%112 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%113 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%114 = getelementptr inbounds i8, i8* %113, i64 6
%115 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%116 = getelementptr inbounds i8, i8* %115, i64 0
%117 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%118 = getelementptr inbounds i8, i8* %117, i64 3
%119 = call i32 @sprintf(i8* %112, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i8* %114, i8* %116, i8* %118)
%120 = load i32, i32* %4
%121 = icmp sgt i32 %120, 0
br i1 %121, label %122, label %137
122: ; preds = %109
%123 = load i8**, i8*** %5
%124 = getelementptr inbounds i8*, i8** %123, i64 0
%125 = load i8*, i8** %124
%126 = call i32* @fopen(i8* %125, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %126, i32** %11
%127 = load i32*, i32** %11
%128 = icmp eq i32* %127, null
br i1 %128, label %129, label %136
129: ; preds = %122
%130 = load i32*, i32** @stderr
%131 = load i8**, i8*** %5
%132 = getelementptr inbounds i8*, i8** %131, i64 0
%133 = load i8*, i8** %132
%134 = call i32 (i32*, i8*, ...) @fprintf(i32* %130, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* %133)
%135 = call i32 @exit(i32 -1)
unreachable
136: ; preds = %122
br label %139
137: ; preds = %109
%138 = load i32*, i32** @stdout
store i32* %138, i32** %11
br label %139
139: ; preds = %137, %136
%140 = load i32*, i32** %11
%141 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%142 = call i32 (i32*, i8*, ...) @fprintf(i32* %140, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i8* %141)
%143 = load i32*, i32** %11
%144 = call i32 (i32*, i8*, ...) @fprintf(i32* %143, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%145 = load i32*, i32** %11
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %145, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0))
%147 = load i32*, i32** %11
%148 = call i32 (i32*, i8*, ...) @fprintf(i32* %147, i8* getelementptr inbounds ([240 x i8], [240 x i8]* @.str.12, i64 0, i64 0))
%149 = load i32*, i32** %11
%150 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%151 = call i32 (i32*, i8*, ...) @fprintf(i32* %149, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %150)
%152 = load i32*, i32** %11
%153 = load i32*, i32** @stdout
%154 = icmp ne i32* %152, %153
br i1 %154, label %155, label %158
155: ; preds = %139
%156 = load i32*, i32** %11
%157 = call i32 @fclose(i32* %156)
br label %158
158: ; preds = %155, %139
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"../VERSION\00"
@.str.1 = [16 x i8] c"../RELEASE-DATE\00"
@.str.2 = [3 x i8] c"-v\00"
@.str.3 = [3 x i8] c"-r\00"
@stderr = global i32* null
@.str.4 = [42 x i8] c"mkversion: No version information in %s.\0A\00"
@.str.5 = [47 x i8] c"mkversion: No release date information in %s.\0A\00"
@.str.6 = [40 x i8] c"#define TIFFLIB_VERSION %4.4s%2.2s%2.2s\00"
@.str.7 = [2 x i8] c"w\00"
@.str.8 = [44 x i8] c"mkversion: %s: Could not open for writing.\0A\00"
@stdout = global i32* null
@.str.9 = [51 x i8] c"#define TIFFLIB_VERSION_STR \22LIBTIFF, Version %s\\n\00"
@.str.10 = [38 x i8] c"Copyright (c) 1988-1996 Sam Leffler\\n\00"
@.str.11 = [49 x i8] c"Copyright (c) 1991-1996 Silicon Graphics, Inc.\22\0A\00"
@.str.12 = [240 x i8] c"/*\0A * This define can be used in code that requires\0A * compilation-related definitions specific to a\0A * version or versions of the library. Runtime\0A * version checking should be done based on the\0A * string returned by TIFFGetVersion.\0A */\0A\00"
@.str.13 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [128 x i8]
%4 = alloca [128 x i8]
%5 = alloca [128 x i8]
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = icmp sgt i32 %0, 1
br i1 %10, label %11, label %50
11: ; preds = %2, %38
%12 = phi i8** [ %43, %38 ], [ %9, %2 ]
%13 = phi i32 [ %42, %38 ], [ %0, %2 ]
%14 = phi i8* [ %41, %38 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), %2 ]
%15 = phi i8* [ %40, %38 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %2 ]
%16 = phi i8** [ %39, %38 ], [ %1, %2 ]
%17 = add nsw i32 %13, -1
%18 = load i8*, i8** %12
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 45
br i1 %20, label %21, label %45
21: ; preds = %11
%22 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = add nsw i32 %13, -2
%26 = getelementptr inbounds i8*, i8** %16, i64 2
%27 = load i8*, i8** %26
br label %38
28: ; preds = %21
%29 = load i8*, i8** %12
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %28
%33 = add nsw i32 %13, -2
%34 = getelementptr inbounds i8*, i8** %16, i64 2
%35 = load i8*, i8** %34
br label %38
36: ; preds = %28
%37 = tail call i32 (...) @usage()
br label %38
38: ; preds = %32, %36, %24
%39 = phi i8** [ %26, %24 ], [ %34, %32 ], [ %12, %36 ]
%40 = phi i8* [ %27, %24 ], [ %15, %32 ], [ %15, %36 ]
%41 = phi i8* [ %14, %24 ], [ %35, %32 ], [ %14, %36 ]
%42 = phi i32 [ %25, %24 ], [ %33, %32 ], [ %17, %36 ]
%43 = getelementptr inbounds i8*, i8** %39, i64 1
%44 = icmp sgt i32 %42, 1
br i1 %44, label %11, label %45
45: ; preds = %38, %11
%46 = phi i8* [ %15, %11 ], [ %40, %38 ]
%47 = phi i8* [ %14, %11 ], [ %41, %38 ]
%48 = phi i8** [ %12, %11 ], [ %43, %38 ]
%49 = xor i1 %20, true
br label %50
50: ; preds = %45, %2
%51 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %2 ], [ %46, %45 ]
%52 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), %2 ], [ %47, %45 ]
%53 = phi i8** [ %9, %2 ], [ %48, %45 ]
%54 = phi i1 [ false, %2 ], [ %49, %45 ]
%55 = tail call i32* @openFile(i8* %51)
%56 = call i32* @fgets(i8* %6, i32 127, i32* %55)
%57 = icmp eq i32* %56, null
br i1 %57, label %58, label %62
58: ; preds = %50
%59 = load i32*, i32** @stderr
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i8* %51)
%61 = call i32 @exit(i32 -1)
unreachable
62: ; preds = %50
%63 = call i8* @strchr(i8* %6, i8 signext 10)
%64 = icmp eq i8* %63, null
br i1 %64, label %66, label %65
65: ; preds = %62
store i8 0, i8* %63
br label %66
66: ; preds = %65, %62
%67 = call i32 @fclose(i32* %55)
%68 = call i32* @openFile(i8* %52)
%69 = call i32* @fgets(i8* %7, i32 127, i32* %68)
%70 = icmp eq i32* %69, null
br i1 %70, label %71, label %75
71: ; preds = %66
%72 = load i32*, i32** @stderr
%73 = call i32 (i32*, i8*, ...) @fprintf(i32* %72, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), i8* %52)
%74 = call i32 @exit(i32 -1)
unreachable
75: ; preds = %66
%76 = call i32 @fclose(i32* %68)
%77 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 6
%78 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 3
%79 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), i8* %77, i8* %7, i8* %78)
br i1 %54, label %80, label %89
80: ; preds = %75
%81 = load i8*, i8** %53
%82 = call i32* @fopen(i8* %81, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%83 = icmp eq i32* %82, null
br i1 %83, label %84, label %91
84: ; preds = %80
%85 = load i32*, i32** @stderr
%86 = load i8*, i8** %53
%87 = call i32 (i32*, i8*, ...) @fprintf(i32* %85, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* %86)
%88 = call i32 @exit(i32 -1)
unreachable
89: ; preds = %75
%90 = load i32*, i32** @stdout
br label %91
91: ; preds = %80, %89
%92 = phi i32* [ %82, %80 ], [ %90, %89 ]
%93 = call i32 (i32*, i8*, ...) @fprintf(i32* %92, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.9, i64 0, i64 0), i8* %6)
%94 = call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), i64 37, i64 1, i32* %92)
%95 = call i64 @fwrite(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0), i64 48, i64 1, i32* %92)
%96 = call i64 @fwrite(i8* getelementptr inbounds ([240 x i8], [240 x i8]* @.str.12, i64 0, i64 0), i64 239, i64 1, i32* %92)
%97 = call i32 (i32*, i8*, ...) @fprintf(i32* %92, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %8)
%98 = load i32*, i32** @stdout
%99 = icmp eq i32* %92, %98
br i1 %99, label %102, label %100
100: ; preds = %91
%101 = call i32 @fclose(i32* %92)
br label %102
102: ; preds = %100, %91
ret i32 0
}