#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*/ FILE;

/* Variables and functions */
int EOF;
int EXIT_FAILURE;
int EXIT_SUCCESS;
int Z_DEFAULT_COMPRESSION;
int compress_data(int, unsigned char **, size_t, size_t *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ free(unsigned char *);
int getopt(int, char **, char *);
int load_file(char *, unsigned char **, size_t *);
char *optarg;
int optind;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ process(int /*<<< orphan*/ *, unsigned char *, size_t,
                           size_t, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdout;
char *strerror(int);
int main(int argc, char *argv[]) {
  FILE *fpout;
  char const *tag;
  int c;
  int level;
  fpout = stdout;
  tag = "data";
  level = 0;
  while ((c = getopt(argc, argv, "o:t:hz0123456789")) != EOF) {
    switch (c) {
    default:
    case 'h':
      fprintf(stderr, "usage: %s [-o output] [-t tag] [-z] [-h] files... \n",
              argv[0]);
      return EXIT_FAILURE;
    case 't':
      tag = optarg;
      for (; *optarg; optarg++) {
        if (*optarg == '-')
          *optarg = '_';
        else if (*optarg == '.')
          *optarg = '_';
      }
      break;
    case 'o':
      fpout = fopen(optarg, "wb");
      if (fpout == NULL) {
        perror(optarg);
        exit(EXIT_FAILURE);
      }
      break;
    case 'z':
      level = Z_DEFAULT_COMPRESSION;
      break;
    case '0':
    case '1':
    case '2':
    case '3':
    case '4':
    case '5':
    case '6':
    case '7':
    case '8':
    case '9':
      level = c - '0';
      break;
    }
  }
  if (optind == argc) {
    fprintf(stderr, "usage: %s [-o output] [-t tag] [-z] [-h] files... \n",
            argv[0]);
    return EXIT_FAILURE;
  } else {
    for (int i = optind; i < argc; i++) {
      unsigned char *data;
      size_t datasize;
      size_t realdatasize;
      int rc;
      rc = load_file(argv[i], &data, &realdatasize);
      if (rc != 0) {
        fprintf(stderr, "%s: %s\n", argv[i], strerror(rc));
        free(data);
        return EXIT_FAILURE;
      }
      rc = compress_data(level, &data, realdatasize, &datasize);
      if (rc != 0) {
        fprintf(stderr, "%s: %s\n", argv[1], strerror(rc));
        free(data);
        return EXIT_FAILURE;
      }
      process(fpout, data, datasize, realdatasize, tag);
      free(data);
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2df0(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
lea    0xf5e(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xf4a(%rip),%rdx
call   10a0 <getopt@plt>
mov    %eax,-0x24(%rbp)
mov    0x2dea(%rip),%rcx
cmp    (%rcx),%eax
je     1359 <main+0x1b9>
mov    -0x24(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x58(%rbp)
sub    $0x4a,%eax
ja     1227 <main+0x87>
mov    -0x58(%rbp),%rax
lea    0xde2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    122c <main+0x8c>
mov    0x2d95(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeff(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d67(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    14e2 <main+0x342>
mov    0x2d96(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    0x2d88(%rip),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
je     12ee <main+0x14e>
mov    0x2d75(%rip),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    12a4 <main+0x104>
mov    0x2d5f(%rip),%rax
mov    (%rax),%rax
movb   $0x5f,(%rax)
jmp    12cc <main+0x12c>
mov    0x2d4d(%rip),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    12c7 <main+0x127>
mov    0x2d37(%rip),%rax
mov    (%rax),%rax
movb   $0x5f,(%rax)
jmp    12cc <main+0x12c>
jmp    12d1 <main+0x131>
mov    0x2d20(%rip),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    0x2d12(%rip),%rax
mov    %rcx,(%rax)
jmp    1269 <main+0xc9>
jmp    1354 <main+0x1b4>
mov    0x2cfe(%rip),%rax
mov    (%rax),%rdi
lea    0xe72(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1335 <main+0x195>
mov    0x2cd9(%rip),%rax
mov    (%rax),%rdi
call   1090 <perror@plt>
mov    0x2c8a(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
jmp    1354 <main+0x1b4>
mov    0x2c7f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
jmp    1354 <main+0x1b4>
mov    -0x24(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x28(%rbp)
jmp    11d9 <main+0x39>
mov    0x2c78(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    139a <main+0x1fa>
mov    0x2c56(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdc0(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2c28(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    14e2 <main+0x342>
mov    0x2c37(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    14d1 <main+0x331>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x38(%rbp),%rsi
lea    -0x48(%rbp),%rdx
call   1070 <load_file@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     142e <main+0x28e>
mov    0x2be9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x60(%rbp)
mov    -0x4c(%rbp),%edi
call   10c0 <strerror@plt>
mov    -0x64(%rbp),%edi
mov    -0x60(%rbp),%rdx
mov    %rax,%rcx
lea    0xd6c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    0x2b94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    14e2 <main+0x342>
mov    -0x28(%rbp),%edi
mov    -0x48(%rbp),%rdx
lea    -0x38(%rbp),%rsi
lea    -0x40(%rbp),%rcx
call   1040 <compress_data@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
je     14a1 <main+0x301>
mov    0x2b72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x74(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x70(%rbp)
mov    -0x4c(%rbp),%edi
call   10c0 <strerror@plt>
mov    -0x74(%rbp),%edi
mov    -0x70(%rbp),%rdx
mov    %rax,%rcx
lea    0xcf9(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    0x2b21(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    14e2 <main+0x342>
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1050 <process@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13a6 <main+0x206>
jmp    14d6 <main+0x336>
mov    0x2acb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2df6(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x28(%rsp)
lea    0xe3c(%rip),%rdx
call   10a0 <getopt@plt>
mov    0x2e0b(%rip),%r15
cmp    (%r15),%eax
jne    1221 <main+0x81>
xor    %r13d,%r13d
lea    0xe1c(%rip),%rax
mov    %rax,0x8(%rsp)
mov    0x2de8(%rip),%rax
movslq (%rax),%rax
cmp    %ebp,%eax
jne    12be <main+0x11e>
mov    0x2dc6(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe08(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2d9c(%rip),%rax
jmp    13bd <main+0x21d>
lea    0xdd8(%rip),%rcx
mov    %rcx,0x8(%rsp)
xor    %r13d,%r13d
lea    0xdce(%rip),%r12
mov    0x2dba(%rip),%r14
jmp    1255 <main+0xb5>
mov    %ecx,%r13d
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
call   10a0 <getopt@plt>
cmp    (%r15),%eax
je     11e9 <main+0x49>
lea    -0x30(%rax),%ecx
cmp    $0xa,%ecx
jb     1240 <main+0xa0>
cmp    $0x6f,%eax
je     1278 <main+0xd8>
cmp    $0x74,%eax
je     1296 <main+0xf6>
cmp    $0x7a,%eax
jne    11fb <main+0x5b>
mov    0x2d4d(%rip),%rax
mov    (%rax),%r13d
jmp    1243 <main+0xa3>
mov    (%r14),%rdi
lea    0xdc8(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,0x28(%rsp)
test   %rax,%rax
jne    1243 <main+0xa3>
jmp    13ce <main+0x22e>
mov    (%r14),%rax
mov    %rax,0x8(%rsp)
jmp    12ad <main+0x10d>
movb   $0x5f,(%rax)
mov    (%r14),%rax
add    $0x1,%rax
mov    %rax,(%r14)
movzbl (%rax),%ecx
lea    -0x2d(%rcx),%edx
cmp    $0x2,%dl
jb     12a0 <main+0x100>
test   %cl,%cl
jne    12a3 <main+0x103>
jmp    1243 <main+0xa3>
cmp    %ebp,%eax
jge    13b6 <main+0x216>
mov    %r13d,0x1c(%rsp)
movslq %ebp,%rcx
mov    %rcx,0x20(%rsp)
mov    %rbx,0x38(%rsp)
lea    (%rbx,%rax,8),%rbx
sub    %eax,%ebp
add    $0x1,%rax
mov    $0x1,%r13b
lea    0x10(%rsp),%r12
nopw   0x0(%rax,%rax,1)
mov    %rax,%r15
mov    (%rbx),%rdi
mov    %r12,%rsi
lea    0x30(%rsp),%rdx
call   1070 <load_file@plt>
test   %eax,%eax
jne    1379 <main+0x1d9>
mov    0x30(%rsp),%rdx
mov    0x1c(%rsp),%edi
mov    %r12,%r14
mov    %r12,%rsi
lea    0x40(%rsp),%rcx
call   1040 <compress_data@plt>
test   %eax,%eax
jne    1370 <main+0x1d0>
mov    0x10(%rsp),%rsi
mov    0x40(%rsp),%rdx
mov    0x30(%rsp),%rcx
mov    0x28(%rsp),%rdi
mov    0x8(%rsp),%r8
call   1050 <process@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
cmp    0x20(%rsp),%r15
setl   %r13b
add    $0x8,%rbx
lea    0x1(%r15),%rax
add    $0xffffffff,%ebp
mov    %r14,%r12
jne    12f0 <main+0x150>
xor    %eax,%eax
cmp    0x20(%rsp),%r15
jge    13b6 <main+0x216>
jmp    13bf <main+0x21f>
mov    0x38(%rsp),%rbx
add    $0x8,%rbx
mov    0x2c48(%rip),%rcx
mov    (%rcx),%ebp
mov    (%rbx),%rbx
mov    %eax,%edi
call   10c0 <strerror@plt>
lea    0xcba(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
test   $0x1,%r13b
jne    1215 <main+0x75>
mov    0x2beb(%rip),%rax
mov    (%rax),%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%r14),%rdi
call   1090 <perror@plt>
mov    0x2bdb(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@stdout = global i32* null
@.str = [5 x i8] c"data\00"
@.str.1 = [17 x i8] c"o:t:hz0123456789\00"
@EOF = global i32 0
@stderr = global i32 0
@.str.2 = [52 x i8] c"usage: %s [-o output] [-t tag] [-z] [-h] files... \0A\00"
@EXIT_FAILURE = global i32 0
@optarg = global i8* null
@.str.3 = [3 x i8] c"wb\00"
@Z_DEFAULT_COMPRESSION = global i32 0
@optind = global i32 0
@.str.4 = [8 x i8] c"%s: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32*, i32** @stdout
store i32* %15, i32** %6
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %7
store i32 0, i32* %9
br label %16
16: ; preds = %74, %2
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = call i32 @getopt(i32 %17, i8** %18, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 %19, i32* %8
%20 = load i32, i32* @EOF
%21 = icmp ne i32 %19, %20
br i1 %21, label %22, label %75
22: ; preds = %16
%23 = load i32, i32* %8
switch i32 %23, label %24 [
i32 104, label %25
i32 116, label %32
i32 111, label %58
i32 122, label %69
i32 48, label %71
i32 49, label %71
i32 50, label %71
i32 51, label %71
i32 52, label %71
i32 53, label %71
i32 54, label %71
i32 55, label %71
i32 56, label %71
i32 57, label %71
]
24: ; preds = %22
br label %25
25: ; preds = %22, %24
%26 = load i32, i32* @stderr
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
%30 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i8* %29)
%31 = load i32, i32* @EXIT_FAILURE
store i32 %31, i32* %3
br label %146
32: ; preds = %22
%33 = load i8*, i8** @optarg
store i8* %33, i8** %7
br label %34
34: ; preds = %54, %32
%35 = load i8*, i8** @optarg
%36 = load i8, i8* %35
%37 = icmp ne i8 %36, 0
br i1 %37, label %38, label %57
38: ; preds = %34
%39 = load i8*, i8** @optarg
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 45
br i1 %42, label %43, label %45
43: ; preds = %38
%44 = load i8*, i8** @optarg
store i8 95, i8* %44
br label %53
45: ; preds = %38
%46 = load i8*, i8** @optarg
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 46
br i1 %49, label %50, label %52
50: ; preds = %45
%51 = load i8*, i8** @optarg
store i8 95, i8* %51
br label %52
52: ; preds = %50, %45
br label %53
53: ; preds = %52, %43
br label %54
54: ; preds = %53
%55 = load i8*, i8** @optarg
%56 = getelementptr inbounds i8, i8* %55, i32 1
store i8* %56, i8** @optarg
br label %34
57: ; preds = %34
br label %74
58: ; preds = %22
%59 = load i8*, i8** @optarg
%60 = call i32* @fopen(i8* %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %60, i32** %6
%61 = load i32*, i32** %6
%62 = icmp eq i32* %61, null
br i1 %62, label %63, label %68
63: ; preds = %58
%64 = load i8*, i8** @optarg
%65 = call i32 @perror(i8* %64)
%66 = load i32, i32* @EXIT_FAILURE
%67 = call i32 @exit(i32 %66)
unreachable
68: ; preds = %58
br label %74
69: ; preds = %22
%70 = load i32, i32* @Z_DEFAULT_COMPRESSION
store i32 %70, i32* %9
br label %74
71: ; preds = %22, %22, %22, %22, %22, %22, %22, %22, %22, %22
%72 = load i32, i32* %8
%73 = sub nsw i32 %72, 48
store i32 %73, i32* %9
br label %74
74: ; preds = %71, %69, %68, %57
br label %16
75: ; preds = %16
%76 = load i32, i32* @optind
%77 = load i32, i32* %4
%78 = icmp eq i32 %76, %77
br i1 %78, label %79, label %86
79: ; preds = %75
%80 = load i32, i32* @stderr
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 0
%83 = load i8*, i8** %82
%84 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i8* %83)
%85 = load i32, i32* @EXIT_FAILURE
store i32 %85, i32* %3
br label %146
86: ; preds = %75
%87 = load i32, i32* @optind
store i32 %87, i32* %10
br label %88
88: ; preds = %140, %86
%89 = load i32, i32* %10
%90 = load i32, i32* %4
%91 = icmp slt i32 %89, %90
br i1 %91, label %92, label %143
92: ; preds = %88
%93 = load i8**, i8*** %5
%94 = load i32, i32* %10
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i8*, i8** %93, i64 %95
%97 = load i8*, i8** %96
%98 = call i32 @load_file(i8* %97, i8** %11, i64* %13)
store i32 %98, i32* %14
%99 = load i32, i32* %14
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %114
101: ; preds = %92
%102 = load i32, i32* @stderr
%103 = load i8**, i8*** %5
%104 = load i32, i32* %10
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8*, i8** %103, i64 %105
%107 = load i8*, i8** %106
%108 = load i32, i32* %14
%109 = call i8* @strerror(i32 %108)
%110 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %107, i8* %109)
%111 = load i8*, i8** %11
%112 = call i32 @free(i8* %111)
%113 = load i32, i32* @EXIT_FAILURE
store i32 %113, i32* %3
br label %146
114: ; preds = %92
%115 = load i32, i32* %9
%116 = load i64, i64* %13
%117 = call i32 @compress_data(i32 %115, i8** %11, i64 %116, i64* %12)
store i32 %117, i32* %14
%118 = load i32, i32* %14
%119 = icmp ne i32 %118, 0
br i1 %119, label %120, label %131
120: ; preds = %114
%121 = load i32, i32* @stderr
%122 = load i8**, i8*** %5
%123 = getelementptr inbounds i8*, i8** %122, i64 1
%124 = load i8*, i8** %123
%125 = load i32, i32* %14
%126 = call i8* @strerror(i32 %125)
%127 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %124, i8* %126)
%128 = load i8*, i8** %11
%129 = call i32 @free(i8* %128)
%130 = load i32, i32* @EXIT_FAILURE
store i32 %130, i32* %3
br label %146
131: ; preds = %114
%132 = load i32*, i32** %6
%133 = load i8*, i8** %11
%134 = load i64, i64* %12
%135 = load i64, i64* %13
%136 = load i8*, i8** %7
%137 = call i32 @process(i32* %132, i8* %133, i64 %134, i64 %135, i8* %136)
%138 = load i8*, i8** %11
%139 = call i32 @free(i8* %138)
br label %140
140: ; preds = %131
%141 = load i32, i32* %10
%142 = add nsw i32 %141, 1
store i32 %142, i32* %10
br label %88
143: ; preds = %88
br label %144
144: ; preds = %143
%145 = load i32, i32* @EXIT_SUCCESS
store i32 %145, i32* %3
br label %146
146: ; preds = %144, %120, %101, %79, %25
%147 = load i32, i32* %3
ret i32 %147
}

LLVM IR (-O2):
@stdout = global i32* null
@.str = [5 x i8] c"data\00"
@.str.1 = [17 x i8] c"o:t:hz0123456789\00"
@EOF = global i32 0
@stderr = global i32 0
@.str.2 = [52 x i8] c"usage: %s [-o output] [-t tag] [-z] [-h] files... \0A\00"
@EXIT_FAILURE = global i32 0
@optarg = global i8* null
@.str.3 = [3 x i8] c"wb\00"
@Z_DEFAULT_COMPRESSION = global i32 0
@optind = global i32 0
@.str.4 = [8 x i8] c"%s: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = load i32*, i32** @stdout
%7 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %49, label %10
10: ; preds = %2, %42
%11 = phi i32 [ %46, %42 ], [ %7, %2 ]
%12 = phi i32 [ %45, %42 ], [ 0, %2 ]
%13 = phi i8* [ %44, %42 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %2 ]
%14 = phi i32* [ %43, %42 ], [ %6, %2 ]
switch i32 %11, label %15 [
i32 57, label %40
i32 116, label %20
i32 111, label %29
i32 122, label %38
i32 48, label %40
i32 49, label %40
i32 50, label %40
i32 51, label %40
i32 52, label %40
i32 53, label %40
i32 54, label %40
i32 55, label %40
i32 56, label %40
]
15: ; preds = %10
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %1
%18 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = load i32, i32* @EXIT_FAILURE
br label %111
20: ; preds = %10
%21 = load i8*, i8** @optarg
br label %22
22: ; preds = %26, %20
%23 = phi i8* [ %28, %26 ], [ %21, %20 ]
%24 = load i8, i8* %23
switch i8 %24, label %26 [
i8 0, label %42
i8 45, label %25
i8 46, label %25
]
25: ; preds = %22, %22
store i8 95, i8* %23
br label %26
26: ; preds = %25, %22
%27 = load i8*, i8** @optarg
%28 = getelementptr inbounds i8, i8* %27, i64 1
store i8* %28, i8** @optarg
br label %22
29: ; preds = %10
%30 = load i8*, i8** @optarg
%31 = tail call i32* @fopen(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i32* %31, null
br i1 %32, label %33, label %42
33: ; preds = %29
%34 = load i8*, i8** @optarg
%35 = tail call i32 @perror(i8* %34)
%36 = load i32, i32* @EXIT_FAILURE
%37 = tail call i32 @exit(i32 %36)
unreachable
38: ; preds = %10
%39 = load i32, i32* @Z_DEFAULT_COMPRESSION
br label %42
40: ; preds = %10, %10, %10, %10, %10, %10, %10, %10, %10, %10
%41 = add nsw i32 %11, -48
br label %42
42: ; preds = %22, %29, %40, %38
%43 = phi i32* [ %14, %38 ], [ %31, %29 ], [ %14, %40 ], [ %14, %22 ]
%44 = phi i8* [ %13, %38 ], [ %13, %29 ], [ %13, %40 ], [ %21, %22 ]
%45 = phi i32 [ %39, %38 ], [ %12, %29 ], [ %41, %40 ], [ %12, %22 ]
%46 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%47 = load i32, i32* @EOF
%48 = icmp eq i32 %46, %47
br i1 %48, label %49, label %10
49: ; preds = %42, %2
%50 = phi i32* [ %6, %2 ], [ %43, %42 ]
%51 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %2 ], [ %44, %42 ]
%52 = phi i32 [ 0, %2 ], [ %45, %42 ]
%53 = load i32, i32* @optind
%54 = icmp eq i32 %53, %0
br i1 %54, label %65, label %55
55: ; preds = %49
%56 = icmp slt i32 %53, %0
br i1 %56, label %59, label %57
57: ; preds = %55
%58 = load i32, i32* @EXIT_SUCCESS
br label %111
59: ; preds = %55
%60 = bitcast i8** %3 to i8*
%61 = bitcast i64* %4 to i8*
%62 = bitcast i64* %5 to i8*
%63 = sext i32 %53 to i64
%64 = sext i32 %0 to i64
br label %70
65: ; preds = %49
%66 = load i32, i32* @stderr
%67 = load i8*, i8** %1
%68 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), i8* %67)
%69 = load i32, i32* @EXIT_FAILURE
br label %111
70: ; preds = %59, %96
%71 = phi i64 [ %63, %59 ], [ %103, %96 ]
%72 = phi i1 [ true, %59 ], [ %104, %96 ]
%73 = getelementptr inbounds i8*, i8** %1, i64 %71
%74 = load i8*, i8** %73
%75 = call i32 @load_file(i8* %74, i8** %3, i64* %5)
%76 = icmp eq i32 %75, 0
br i1 %76, label %79, label %77
77: ; preds = %70
%78 = getelementptr inbounds i8*, i8** %1, i64 %71
br label %85
79: ; preds = %70
%80 = load i64, i64* %5
%81 = call i32 @compress_data(i32 %52, i8** %3, i64 %80, i64* %4)
%82 = icmp eq i32 %81, 0
br i1 %82, label %96, label %83
83: ; preds = %79
%84 = getelementptr inbounds i8*, i8** %1, i64 1
br label %85
85: ; preds = %77, %83
%86 = phi i8** [ %78, %77 ], [ %84, %83 ]
%87 = phi i32 [ %75, %77 ], [ %81, %83 ]
%88 = load i32, i32* @stderr
%89 = load i8*, i8** %86
%90 = call i8* @strerror(i32 %87)
%91 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %89, i8* %90)
%92 = load i8*, i8** %3
%93 = call i32 @free(i8* %92)
%94 = load i32, i32* @EXIT_FAILURE
%95 = load i32, i32* @EXIT_SUCCESS
br i1 %72, label %109, label %111
96: ; preds = %79
%97 = load i8*, i8** %3
%98 = load i64, i64* %4
%99 = load i64, i64* %5
%100 = call i32 @process(i32* %50, i8* %97, i64 %98, i64 %99, i8* %51)
%101 = load i8*, i8** %3
%102 = call i32 @free(i8* %101)
%103 = add nsw i64 %71, 1
%104 = icmp slt i64 %103, %64
%105 = trunc i64 %103 to i32
%106 = icmp eq i32 %105, %0
br i1 %106, label %107, label %70
107: ; preds = %96
%108 = load i32, i32* @EXIT_SUCCESS
br i1 %104, label %109, label %111
109: ; preds = %85, %107
%110 = phi i32 [ %94, %85 ], [ 0, %107 ]
br label %111
111: ; preds = %109, %107, %57, %85, %65, %15
%112 = phi i32 [ %19, %15 ], [ %69, %65 ], [ %110, %109 ], [ %108, %107 ], [ %58, %57 ], [ %95, %85 ]
ret i32 %112
}