#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*/ alpha;
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*/ 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 *alphaFile = "../dist/tiff.alpha";
  char version[128];
  char alpha[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], "-a") == 0) {
      if (argc < 1)
        usage();
      argc--, argv++;
      alphaFile = 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(alphaFile);
  if (fgets(alpha, sizeof(alpha) - 1, fd) == NULL) {
    fprintf(stderr, "mkversion: No alpha information in %s.\n", alphaFile);
    exit(-1);
  }
  fclose(fd);
  cp = strchr(alpha, ' ');
  if (cp)
    cp = strchr(cp + 1, ' ');
  if (cp) {
    char *tp;
    for (tp = strchr(version, '\0'), cp++; (*tp = *cp) != 0; tp++, cp++)
      ;
    if (tp[-1] == '\n')
      tp[-1] = '\0';
  } else {
    fprintf(stderr, "mkversion: Malformed alpha information in %s.\n",
            alphaFile);
    exit(-1);
  }
  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 VERSION \"LIBTIFF, Version %s\\n", version);
  fprintf(fd, "Copyright (c) 1988-1996 Sam Leffler\\n");
  fprintf(fd, "Copyright (c) 1991-1996 Silicon Graphics, Inc.\"\n");
  if (fd != stdout)
    fclose(fd);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe50(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe50(%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,-0x139(%rbp)
jle    11fc <main+0x6c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x139(%rbp)
mov    -0x139(%rbp),%al
test   $0x1,%al
jne    120f <main+0x7f>
jmp    12db <main+0x14b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe01(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1262 <main+0xd2>
cmpl   $0x1,-0x8(%rbp)
jge    123d <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    12c1 <main+0x131>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdb1(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12b5 <main+0x125>
cmpl   $0x1,-0x8(%rbp)
jge    1290 <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    12bc <main+0x12c>
mov    $0x0,%al
call   1090 <usage@plt>
jmp    12c1 <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    11d4 <main+0x44>
mov    -0x18(%rbp),%rdi
call   1040 <openFile@plt>
mov    %rax,-0x128(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x128(%rbp),%rdx
mov    $0x7f,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    1333 <main+0x1a3>
mov    0x2ccc(%rip),%rax
movslq (%rax),%rdi
mov    -0x18(%rbp),%rdx
lea    0xd02(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
lea    -0xa0(%rbp),%rdi
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,-0x130(%rbp)
cmpq   $0x0,-0x130(%rbp)
je     1363 <main+0x1d3>
mov    -0x130(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x128(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <openFile@plt>
mov    %rax,-0x128(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x128(%rbp),%rdx
mov    $0x7f,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    13c7 <main+0x237>
mov    0x2c38(%rip),%rax
movslq (%rax),%rdi
mov    -0x20(%rbp),%rdx
lea    0xc98(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
mov    -0x128(%rbp),%rdi
call   1030 <fclose@plt>
lea    -0x120(%rbp),%rdi
mov    $0x20,%esi
call   1050 <strchr@plt>
mov    %rax,-0x130(%rbp)
cmpq   $0x0,-0x130(%rbp)
je     1415 <main+0x285>
mov    -0x130(%rbp),%rdi
add    $0x1,%rdi
mov    $0x20,%esi
call   1050 <strchr@plt>
mov    %rax,-0x130(%rbp)
cmpq   $0x0,-0x130(%rbp)
je     14ba <main+0x32a>
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
call   1050 <strchr@plt>
mov    %rax,-0x138(%rbp)
mov    -0x130(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x130(%rbp)
mov    -0x130(%rbp),%rax
mov    (%rax),%al
mov    -0x138(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1496 <main+0x306>
jmp    146d <main+0x2dd>
mov    -0x138(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x138(%rbp)
mov    -0x130(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x130(%rbp)
jmp    144a <main+0x2ba>
mov    -0x138(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0xa,%eax
jne    14b5 <main+0x325>
mov    -0x138(%rbp),%rax
movb   $0x0,-0x1(%rax)
jmp    14e0 <main+0x350>
mov    0x2b1f(%rip),%rax
movslq (%rax),%rdi
mov    -0x20(%rbp),%rdx
lea    0xba7(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1540 <main+0x3b0>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xbad(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x0,-0x128(%rbp)
jne    153b <main+0x3ab>
mov    0x2ac7(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xb7d(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
jmp    1551 <main+0x3c1>
mov    0x2a91(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x128(%rbp)
mov    -0x128(%rbp),%rdi
lea    -0xa0(%rbp),%rdx
lea    0xb6d(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x128(%rbp),%rdi
lea    0xb7f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x128(%rbp),%rdi
lea    0xb90(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x128(%rbp),%rax
mov    0x2a33(%rip),%rcx
cmp    (%rcx),%rax
je     15ba <main+0x42a>
mov    -0x128(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
lea    0x8(%rsi),%r14
cmp    $0x2,%edi
jl     125e <main+0xae>
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe26(%rip),%r15
lea    0xe2a(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xe31(%rip),%r13
jmp    120a <main+0x5a>
nop
add    $0xfffffffe,%ebp
mov    0x10(%rbx),%r15
add    $0x10,%rbx
mov    %rbx,%r14
mov    %r14,%rbx
add    $0x8,%r14
cmp    $0x1,%ebp
jle    1271 <main+0xc1>
mov    0x8(%rbx),%rdi
movzbl (%rdi),%r12d
cmp    $0x2d,%r12b
jne    1271 <main+0xc1>
mov    %r13,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     11f0 <main+0x40>
mov    (%r14),%rdi
lea    0xdf2(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1250 <main+0xa0>
add    $0xffffffff,%ebp
xor    %eax,%eax
call   10a0 <usage@plt>
jmp    11fe <main+0x4e>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xfffffffe,%ebp
mov    0x10(%rbx),%rax
mov    %rax,0x8(%rsp)
jmp    11f7 <main+0x47>
lea    0xda6(%rip),%rbx
lea    0xd94(%rip),%r15
xor    %r12d,%r12d
jmp    127e <main+0xce>
cmp    $0x2d,%r12b
setne  %r12b
mov    0x8(%rsp),%rbx
mov    %r15,%rdi
call   1040 <openFile@plt>
mov    %rax,%rbp
lea    0x10(%rsp),%rdi
mov    $0x7f,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1431 <main+0x281>
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0xa,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     12be <main+0x10e>
movb   $0x0,(%rax)
mov    %rbp,%rdi
call   1030 <fclose@plt>
mov    %rbx,%rdi
call   1040 <openFile@plt>
mov    %rax,%rbp
lea    0x90(%rsp),%rdi
mov    $0x7f,%esi
mov    %rax,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     1447 <main+0x297>
mov    %rbp,%rdi
call   1030 <fclose@plt>
lea    0x90(%rsp),%rdi
mov    $0x20,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     141e <main+0x26e>
add    $0x1,%rax
mov    %rax,%rdi
mov    $0x20,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     141e <main+0x26e>
mov    %rax,%rbp
mov    %r15,%rdi
call   1050 <strlen@plt>
lea    (%rax,%r15,1),%rcx
add    $0xfffffffffffffffe,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbp,%rdx,1),%ebx
mov    %bl,0x2(%rcx,%rdx,1)
add    $0x1,%rdx
test   %bl,%bl
jne    1350 <main+0x1a0>
add    %r15,%rax
cmpb   $0xa,-0x2(%rdx,%rax,1)
jne    136f <main+0x1bf>
movb   $0x0,(%rcx,%rdx,1)
test   %r12b,%r12b
je     13a4 <main+0x1f4>
mov    (%r14),%rdi
lea    0xd27(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    13ae <main+0x1fe>
mov    0x2c4e(%rip),%rax
movslq (%rax),%rdi
mov    (%r14),%rdx
lea    0xd08(%rip),%rsi
jmp    145b <main+0x2ab>
mov    0x2c2d(%rip),%rax
mov    (%rax),%rbx
lea    0xd1e(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xd2f(%rip),%rdi
mov    $0x25,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0xd3c(%rip),%rdi
mov    $0x30,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
mov    0x2bdb(%rip),%rax
cmp    (%rax),%rbx
je     140a <main+0x25a>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bbb(%rip),%rax
movslq (%rax),%rdi
lea    0xc47(%rip),%rsi
jmp    1458 <main+0x2a8>
mov    0x2ba8(%rip),%rax
movslq (%rax),%rdi
lea    0xbe2(%rip),%rsi
mov    %r15,%rdx
jmp    145b <main+0x2ab>
mov    0x2b92(%rip),%rax
movslq (%rax),%rdi
lea    0xbf6(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"../VERSION\00"
@.str.1 = [19 x i8] c"../dist/tiff.alpha\00"
@.str.2 = [3 x i8] c"-v\00"
@.str.3 = [3 x i8] c"-a\00"
@stderr = global i32 0
@.str.4 = [42 x i8] c"mkversion: No version information in %s.\0A\00"
@.str.5 = [40 x i8] c"mkversion: No alpha information in %s.\0A\00"
@.str.6 = [47 x i8] c"mkversion: Malformed alpha information in %s.\0A\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 = [39 x i8] c"#define VERSION \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"
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 i32*
%11 = alloca i8*
%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 ([19 x i8], [19 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** %10
%79 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%80 = load i32*, i32** %10
%81 = call i32* @fgets(i8* %79, i32 127, i32* %80)
%82 = icmp eq i32* %81, null
br i1 %82, label %83, label %90
83: ; preds = %76
%84 = load i32, i32* @stderr
%85 = sext i32 %84 to i64
%86 = inttoptr i64 %85 to i32*
%87 = load i8*, i8** %6
%88 = call i32 (i32*, i8*, ...) @fprintf(i32* %86, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i8* %87)
%89 = call i32 @exit(i32 -1)
unreachable
90: ; preds = %76
%91 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%92 = call i8* @strchr(i8* %91, i8 signext 10)
store i8* %92, i8** %11
%93 = load i8*, i8** %11
%94 = icmp ne i8* %93, null
br i1 %94, label %95, label %97
95: ; preds = %90
%96 = load i8*, i8** %11
store i8 0, i8* %96
br label %97
97: ; preds = %95, %90
%98 = load i32*, i32** %10
%99 = call i32 @fclose(i32* %98)
%100 = load i8*, i8** %7
%101 = call i32* @openFile(i8* %100)
store i32* %101, i32** %10
%102 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%103 = load i32*, i32** %10
%104 = call i32* @fgets(i8* %102, i32 127, i32* %103)
%105 = icmp eq i32* %104, null
br i1 %105, label %106, label %113
106: ; preds = %97
%107 = load i32, i32* @stderr
%108 = sext i32 %107 to i64
%109 = inttoptr i64 %108 to i32*
%110 = load i8*, i8** %7
%111 = call i32 (i32*, i8*, ...) @fprintf(i32* %109, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i8* %110)
%112 = call i32 @exit(i32 -1)
unreachable
113: ; preds = %97
%114 = load i32*, i32** %10
%115 = call i32 @fclose(i32* %114)
%116 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%117 = call i8* @strchr(i8* %116, i8 signext 32)
store i8* %117, i8** %11
%118 = load i8*, i8** %11
%119 = icmp ne i8* %118, null
br i1 %119, label %120, label %124
120: ; preds = %113
%121 = load i8*, i8** %11
%122 = getelementptr inbounds i8, i8* %121, i64 1
%123 = call i8* @strchr(i8* %122, i8 signext 32)
store i8* %123, i8** %11
br label %124
124: ; preds = %120, %113
%125 = load i8*, i8** %11
%126 = icmp ne i8* %125, null
br i1 %126, label %127, label %154
127: ; preds = %124
%128 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%129 = call i8* @strchr(i8* %128, i8 signext 0)
store i8* %129, i8** %12
%130 = load i8*, i8** %11
%131 = getelementptr inbounds i8, i8* %130, i32 1
store i8* %131, i8** %11
br label %132
132: ; preds = %139, %127
%133 = load i8*, i8** %11
%134 = load i8, i8* %133
%135 = load i8*, i8** %12
store i8 %134, i8* %135
%136 = sext i8 %134 to i32
%137 = icmp ne i32 %136, 0
br i1 %137, label %138, label %144
138: ; preds = %132
br label %139
139: ; preds = %138
%140 = load i8*, i8** %12
%141 = getelementptr inbounds i8, i8* %140, i32 1
store i8* %141, i8** %12
%142 = load i8*, i8** %11
%143 = getelementptr inbounds i8, i8* %142, i32 1
store i8* %143, i8** %11
br label %132
144: ; preds = %132
%145 = load i8*, i8** %12
%146 = getelementptr inbounds i8, i8* %145, i64 -1
%147 = load i8, i8* %146
%148 = sext i8 %147 to i32
%149 = icmp eq i32 %148, 10
br i1 %149, label %150, label %153
150: ; preds = %144
%151 = load i8*, i8** %12
%152 = getelementptr inbounds i8, i8* %151, i64 -1
store i8 0, i8* %152
br label %153
153: ; preds = %150, %144
br label %161
154: ; preds = %124
%155 = load i32, i32* @stderr
%156 = sext i32 %155 to i64
%157 = inttoptr i64 %156 to i32*
%158 = load i8*, i8** %7
%159 = call i32 (i32*, i8*, ...) @fprintf(i32* %157, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), i8* %158)
%160 = call i32 @exit(i32 -1)
unreachable
161: ; preds = %153
%162 = load i32, i32* %4
%163 = icmp sgt i32 %162, 0
br i1 %163, label %164, label %181
164: ; preds = %161
%165 = load i8**, i8*** %5
%166 = getelementptr inbounds i8*, i8** %165, i64 0
%167 = load i8*, i8** %166
%168 = call i32* @fopen(i8* %167, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
store i32* %168, i32** %10
%169 = load i32*, i32** %10
%170 = icmp eq i32* %169, null
br i1 %170, label %171, label %180
171: ; preds = %164
%172 = load i32, i32* @stderr
%173 = sext i32 %172 to i64
%174 = inttoptr i64 %173 to i32*
%175 = load i8**, i8*** %5
%176 = getelementptr inbounds i8*, i8** %175, i64 0
%177 = load i8*, i8** %176
%178 = call i32 (i32*, i8*, ...) @fprintf(i32* %174, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* %177)
%179 = call i32 @exit(i32 -1)
unreachable
180: ; preds = %164
br label %183
181: ; preds = %161
%182 = load i32*, i32** @stdout
store i32* %182, i32** %10
br label %183
183: ; preds = %181, %180
%184 = load i32*, i32** %10
%185 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%186 = call i32 (i32*, i8*, ...) @fprintf(i32* %184, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i8* %185)
%187 = load i32*, i32** %10
%188 = call i32 (i32*, i8*, ...) @fprintf(i32* %187, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
%189 = load i32*, i32** %10
%190 = call i32 (i32*, i8*, ...) @fprintf(i32* %189, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0))
%191 = load i32*, i32** %10
%192 = load i32*, i32** @stdout
%193 = icmp ne i32* %191, %192
br i1 %193, label %194, label %197
194: ; preds = %183
%195 = load i32*, i32** %10
%196 = call i32 @fclose(i32* %195)
br label %197
197: ; preds = %194, %183
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"../VERSION\00"
@.str.1 = [19 x i8] c"../dist/tiff.alpha\00"
@.str.2 = [3 x i8] c"-v\00"
@.str.3 = [3 x i8] c"-a\00"
@stderr = global i32 0
@.str.4 = [42 x i8] c"mkversion: No version information in %s.\0A\00"
@.str.5 = [40 x i8] c"mkversion: No alpha information in %s.\0A\00"
@.str.6 = [47 x i8] c"mkversion: Malformed alpha information in %s.\0A\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 = [39 x i8] c"#define VERSION \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"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [128 x i8]
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = icmp sgt i32 %0, 1
br i1 %8, label %9, label %48
9: ; preds = %2, %36
%10 = phi i8** [ %41, %36 ], [ %7, %2 ]
%11 = phi i8* [ %40, %36 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), %2 ]
%12 = phi i8* [ %39, %36 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %2 ]
%13 = phi i8** [ %38, %36 ], [ %1, %2 ]
%14 = phi i32 [ %37, %36 ], [ %0, %2 ]
%15 = add nsw i32 %14, -1
%16 = load i8*, i8** %10
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 45
br i1 %18, label %19, label %43
19: ; preds = %9
%20 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = add nsw i32 %14, -2
%24 = getelementptr inbounds i8*, i8** %13, i64 2
%25 = load i8*, i8** %24
br label %36
26: ; preds = %19
%27 = load i8*, i8** %10
%28 = tail call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %34
30: ; preds = %26
%31 = add nsw i32 %14, -2
%32 = getelementptr inbounds i8*, i8** %13, i64 2
%33 = load i8*, i8** %32
br label %36
34: ; preds = %26
%35 = tail call i32 (...) @usage()
br label %36
36: ; preds = %30, %34, %22
%37 = phi i32 [ %23, %22 ], [ %31, %30 ], [ %15, %34 ]
%38 = phi i8** [ %24, %22 ], [ %32, %30 ], [ %10, %34 ]
%39 = phi i8* [ %25, %22 ], [ %12, %30 ], [ %12, %34 ]
%40 = phi i8* [ %11, %22 ], [ %33, %30 ], [ %11, %34 ]
%41 = getelementptr inbounds i8*, i8** %38, i64 1
%42 = icmp sgt i32 %37, 1
br i1 %42, label %9, label %43
43: ; preds = %36, %9
%44 = phi i8* [ %12, %9 ], [ %39, %36 ]
%45 = phi i8* [ %11, %9 ], [ %40, %36 ]
%46 = phi i8** [ %10, %9 ], [ %41, %36 ]
%47 = xor i1 %18, true
br label %48
48: ; preds = %43, %2
%49 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %2 ], [ %44, %43 ]
%50 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), %2 ], [ %45, %43 ]
%51 = phi i8** [ %7, %2 ], [ %46, %43 ]
%52 = phi i1 [ false, %2 ], [ %47, %43 ]
%53 = tail call i32* @openFile(i8* %49)
%54 = call i32* @fgets(i8* %5, i32 127, i32* %53)
%55 = icmp eq i32* %54, null
br i1 %55, label %56, label %62
56: ; preds = %48
%57 = load i32, i32* @stderr
%58 = sext i32 %57 to i64
%59 = inttoptr i64 %58 to i32*
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i8* %49)
%61 = call i32 @exit(i32 -1)
unreachable
62: ; preds = %48
%63 = call i8* @strchr(i8* %5, 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* %53)
%68 = call i32* @openFile(i8* %50)
%69 = call i32* @fgets(i8* %6, i32 127, i32* %68)
%70 = icmp eq i32* %69, null
br i1 %70, label %71, label %77
71: ; preds = %66
%72 = load i32, i32* @stderr
%73 = sext i32 %72 to i64
%74 = inttoptr i64 %73 to i32*
%75 = call i32 (i32*, i8*, ...) @fprintf(i32* %74, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0), i8* %50)
%76 = call i32 @exit(i32 -1)
unreachable
77: ; preds = %66
%78 = call i32 @fclose(i32* %68)
%79 = call i8* @strchr(i8* %6, i8 signext 32)
%80 = icmp eq i8* %79, null
br i1 %80, label %101, label %81
81: ; preds = %77
%82 = getelementptr inbounds i8, i8* %79, i64 1
%83 = call i8* @strchr(i8* %82, i8 signext 32)
%84 = icmp eq i8* %83, null
br i1 %84, label %101, label %85
85: ; preds = %81
%86 = call i64 @strlen(i8* %5)
%87 = getelementptr [128 x i8], [128 x i8]* %3, i64 0, i64 %86
br label %88
88: ; preds = %88, %85
%89 = phi i8* [ %83, %85 ], [ %91, %88 ]
%90 = phi i8* [ %87, %85 ], [ %94, %88 ]
%91 = getelementptr inbounds i8, i8* %89, i64 1
%92 = load i8, i8* %91
store i8 %92, i8* %90
%93 = icmp eq i8 %92, 0
%94 = getelementptr inbounds i8, i8* %90, i64 1
br i1 %93, label %95, label %88
95: ; preds = %88
%96 = getelementptr inbounds i8, i8* %90, i64 -1
%97 = load i8, i8* %96
%98 = icmp eq i8 %97, 10
br i1 %98, label %99, label %100
99: ; preds = %95
store i8 0, i8* %96
br label %100
100: ; preds = %99, %95
br i1 %52, label %107, label %118
101: ; preds = %77, %81
%102 = load i32, i32* @stderr
%103 = sext i32 %102 to i64
%104 = inttoptr i64 %103 to i32*
%105 = call i32 (i32*, i8*, ...) @fprintf(i32* %104, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), i8* %50)
%106 = call i32 @exit(i32 -1)
unreachable
107: ; preds = %100
%108 = load i8*, i8** %51
%109 = call i32* @fopen(i8* %108, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%110 = icmp eq i32* %109, null
br i1 %110, label %111, label %120
111: ; preds = %107
%112 = load i32, i32* @stderr
%113 = sext i32 %112 to i64
%114 = inttoptr i64 %113 to i32*
%115 = load i8*, i8** %51
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %114, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* %115)
%117 = call i32 @exit(i32 -1)
unreachable
118: ; preds = %100
%119 = load i32*, i32** @stdout
br label %120
120: ; preds = %107, %118
%121 = phi i32* [ %109, %107 ], [ %119, %118 ]
%122 = call i32 (i32*, i8*, ...) @fprintf(i32* %121, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i8* %5)
%123 = call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), i64 37, i64 1, i32* %121)
%124 = call i64 @fwrite(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0), i64 48, i64 1, i32* %121)
%125 = load i32*, i32** @stdout
%126 = icmp eq i32* %121, %125
br i1 %126, label %129, label %127
127: ; preds = %120
%128 = call i32 @fclose(i32* %121)
br label %129
129: ; preds = %127, %120
ret i32 0
}