#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 /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ exit_error(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
unsigned int fread(unsigned char *, int, unsigned int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
unsigned int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(unsigned char *, int, unsigned int,
                          int /*<<< orphan*/ *);
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int tinf_gzip_uncompress(unsigned char *, unsigned int *, unsigned char *,
                         unsigned int);
int /*<<< orphan*/ tinf_init();
int main(int argc, char *argv[]) {
  FILE *fin, *fout;
  unsigned int len, dlen, outlen;
  unsigned char *source, *dest;
  int res;
  printf("tgunzip - example from the tiny inflate library "
         "(www.ibsensoftware.com)\n\n");
  if (argc < 3) {
    printf("Syntax: tgunzip <source> <destination>\n\n"
           "Both input and output are kept in memory, so do not use this on "
           "huge files.\n");
    return 1;
  }
  tinf_init();
  if ((fin = fopen(argv[1], "rb")) == NULL)
    exit_error("source file");
  if ((fout = fopen(argv[2], "wb")) == NULL)
    exit_error("destination file");
  fseek(fin, 0, SEEK_END);
  len = ftell(fin);
  fseek(fin, 0, SEEK_SET);
  source = (unsigned char *)malloc(len);
  if (source == NULL)
    exit_error("memory");
  if (fread(source, 1, len, fin) != len)
    exit_error("read");
  fclose(fin);
  dlen = source[len - 1];
  dlen = 256 * dlen + source[len - 2];
  dlen = 256 * dlen + source[len - 3];
  dlen = 256 * dlen + source[len - 4];
  dest = (unsigned char *)malloc(dlen);
  if (dest == NULL)
    exit_error("memory");
  outlen = dlen;
  res = tinf_gzip_uncompress(dest, &outlen, source, len);
  if ((res != 0) || (outlen != dlen))
    exit_error("inflate");
  printf("decompressed %u bytes\n", outlen);
  fwrite(dest, 1, outlen, fout);
  fclose(fout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0x3,-0x8(%rbp)
jge    11f8 <main+0x48>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13e1 <main+0x231>
mov    $0x0,%al
call   1030 <tinf_init@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeb1(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    122d <main+0x7d>
lea    0xe9a(%rip),%rdi
call   1070 <exit_error@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe92(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    125b <main+0xab>
lea    0xe7b(%rip),%rdi
call   1070 <exit_error@plt>
mov    -0x18(%rbp),%rdi
mov    0x2d82(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1080 <ftell@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d52(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    -0x24(%rbp),%edi
call   1090 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    12b2 <main+0x102>
lea    0xe35(%rip),%rdi
call   1070 <exit_error@plt>
mov    -0x38(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
cmp    -0x24(%rbp),%eax
je     12dc <main+0x12c>
lea    0xe12(%rip),%rdi
call   1070 <exit_error@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
shl    $0x8,%eax
mov    -0x38(%rbp),%rcx
mov    -0x24(%rbp),%edx
sub    $0x2,%edx
mov    %edx,%edx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
shl    $0x8,%eax
mov    -0x38(%rbp),%rcx
mov    -0x24(%rbp),%edx
sub    $0x3,%edx
mov    %edx,%edx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
shl    $0x8,%eax
mov    -0x38(%rbp),%rcx
mov    -0x24(%rbp),%edx
sub    $0x4,%edx
mov    %edx,%edx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
call   1090 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    136c <main+0x1bc>
lea    0xd7b(%rip),%rdi
call   1070 <exit_error@plt>
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x24(%rbp),%ecx
lea    -0x2c(%rbp),%rsi
call   10b0 <tinf_gzip_uncompress@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jne    139f <main+0x1ef>
mov    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
je     13ab <main+0x1fb>
lea    0xd48(%rip),%rdi
call   1070 <exit_error@plt>
mov    -0x2c(%rbp),%esi
lea    0xd41(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x2c(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
call   10d0 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xe76(%rip),%rdi
call   1040 <puts@plt>
cmp    $0x2,%ebp
jg     11f8 <main+0x38>
lea    0xeae(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
jmp    136e <main+0x1ae>
xor    %eax,%eax
call   1030 <tinf_init@plt>
mov    0x8(%rbx),%rdi
lea    0xdf6(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%r15
test   %rax,%rax
jne    1223 <main+0x63>
lea    0xde5(%rip),%rdi
call   1080 <exit_error@plt>
mov    0x10(%rbx),%rdi
lea    0xde1(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1247 <main+0x87>
lea    0xdd0(%rip),%rdi
call   1080 <exit_error@plt>
mov    0x2d9a(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %r15,%rdi
call   1090 <ftell@plt>
mov    %eax,%r12d
mov    0x2d6c(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %r12d,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1294 <main+0xd4>
lea    0xd94(%rip),%rdi
call   1080 <exit_error@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
mov    %r15,%rcx
call   1050 <fread@plt>
cmp    %r12d,%eax
je     12b8 <main+0xf8>
lea    0xd77(%rip),%rdi
call   1080 <exit_error@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
lea    -0x1(%r12),%eax
movzbl (%rbx,%rax,1),%eax
lea    -0x2(%r12),%ecx
movzbl (%rbx,%rcx,1),%ecx
shl    $0x10,%eax
shl    $0x8,%ecx
or     %eax,%ecx
lea    -0x3(%r12),%eax
movzbl (%rbx,%rax,1),%eax
or     %ecx,%eax
shl    $0x8,%eax
mov    %r12d,%ecx
add    $0xfffffffc,%ecx
movzbl (%rbx,%rcx,1),%ebp
or     %eax,%ebp
mov    %ebp,%edi
call   10a0 <malloc@plt>
mov    %rax,%r15
test   %rax,%rax
jne    130f <main+0x14f>
lea    0xd19(%rip),%rdi
call   1080 <exit_error@plt>
mov    %ebp,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
mov    %r12d,%ecx
call   10c0 <tinf_gzip_uncompress@plt>
test   %eax,%eax
jne    1330 <main+0x170>
cmp    %ebp,0xc(%rsp)
je     1340 <main+0x180>
lea    0xcf8(%rip),%rdi
call   1080 <exit_error@plt>
mov    0xc(%rsp),%ebp
lea    0xcf0(%rip),%rdi
xor    %ebx,%ebx
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0xc(%rsp),%edx
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r14,%rcx
call   10e0 <fwrite@plt>
mov    %r14,%rdi
call   1060 <fclose@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [74 x i8] c"tgunzip - example from the tiny inflate library (www.ibsensoftware.com)\0A\0A\00"
@.str.1 = [117 x i8] c"Syntax: tgunzip <source> <destination>\0A\0ABoth input and output are kept in memory, so do not use this on huge files.\0A\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [12 x i8] c"source file\00"
@.str.4 = [3 x i8] c"wb\00"
@.str.5 = [17 x i8] c"destination file\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.6 = [7 x i8] c"memory\00"
@.str.7 = [5 x i8] c"read\00"
@.str.8 = [8 x i8] c"inflate\00"
@.str.9 = [23 x i8] c"decompressed %u bytes\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 3
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %131
19: ; preds = %2
%20 = call i32 (...) @tinf_init()
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32* @fopen(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %24, i32** %6
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %19
%27 = call i32 @exit_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %26, %19
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 2
%31 = load i8*, i8** %30
%32 = call i32* @fopen(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32* %32, i32** %7
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %36
34: ; preds = %28
%35 = call i32 @exit_error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %36
36: ; preds = %34, %28
%37 = load i32*, i32** %6
%38 = load i32, i32* @SEEK_END
%39 = call i32 @fseek(i32* %37, i32 0, i32 %38)
%40 = load i32*, i32** %6
%41 = call i32 @ftell(i32* %40)
store i32 %41, i32* %8
%42 = load i32*, i32** %6
%43 = load i32, i32* @SEEK_SET
%44 = call i32 @fseek(i32* %42, i32 0, i32 %43)
%45 = load i32, i32* %8
%46 = call i64 @malloc(i32 %45)
%47 = inttoptr i64 %46 to i8*
store i8* %47, i8** %11
%48 = load i8*, i8** %11
%49 = icmp eq i8* %48, null
br i1 %49, label %50, label %52
50: ; preds = %36
%51 = call i32 @exit_error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %52
52: ; preds = %50, %36
%53 = load i8*, i8** %11
%54 = load i32, i32* %8
%55 = load i32*, i32** %6
%56 = call i32 @fread(i8* %53, i32 1, i32 %54, i32* %55)
%57 = load i32, i32* %8
%58 = icmp ne i32 %56, %57
br i1 %58, label %59, label %61
59: ; preds = %52
%60 = call i32 @exit_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %61
61: ; preds = %59, %52
%62 = load i32*, i32** %6
%63 = call i32 @fclose(i32* %62)
%64 = load i8*, i8** %11
%65 = load i32, i32* %8
%66 = sub i32 %65, 1
%67 = zext i32 %66 to i64
%68 = getelementptr inbounds i8, i8* %64, i64 %67
%69 = load i8, i8* %68
%70 = zext i8 %69 to i32
store i32 %70, i32* %9
%71 = load i32, i32* %9
%72 = mul i32 256, %71
%73 = load i8*, i8** %11
%74 = load i32, i32* %8
%75 = sub i32 %74, 2
%76 = zext i32 %75 to i64
%77 = getelementptr inbounds i8, i8* %73, i64 %76
%78 = load i8, i8* %77
%79 = zext i8 %78 to i32
%80 = add i32 %72, %79
store i32 %80, i32* %9
%81 = load i32, i32* %9
%82 = mul i32 256, %81
%83 = load i8*, i8** %11
%84 = load i32, i32* %8
%85 = sub i32 %84, 3
%86 = zext i32 %85 to i64
%87 = getelementptr inbounds i8, i8* %83, i64 %86
%88 = load i8, i8* %87
%89 = zext i8 %88 to i32
%90 = add i32 %82, %89
store i32 %90, i32* %9
%91 = load i32, i32* %9
%92 = mul i32 256, %91
%93 = load i8*, i8** %11
%94 = load i32, i32* %8
%95 = sub i32 %94, 4
%96 = zext i32 %95 to i64
%97 = getelementptr inbounds i8, i8* %93, i64 %96
%98 = load i8, i8* %97
%99 = zext i8 %98 to i32
%100 = add i32 %92, %99
store i32 %100, i32* %9
%101 = load i32, i32* %9
%102 = call i64 @malloc(i32 %101)
%103 = inttoptr i64 %102 to i8*
store i8* %103, i8** %12
%104 = load i8*, i8** %12
%105 = icmp eq i8* %104, null
br i1 %105, label %106, label %108
106: ; preds = %61
%107 = call i32 @exit_error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %108
108: ; preds = %106, %61
%109 = load i32, i32* %9
store i32 %109, i32* %10
%110 = load i8*, i8** %12
%111 = load i8*, i8** %11
%112 = load i32, i32* %8
%113 = call i32 @tinf_gzip_uncompress(i8* %110, i32* %10, i8* %111, i32 %112)
store i32 %113, i32* %13
%114 = load i32, i32* %13
%115 = icmp ne i32 %114, 0
br i1 %115, label %120, label %116
116: ; preds = %108
%117 = load i32, i32* %10
%118 = load i32, i32* %9
%119 = icmp ne i32 %117, %118
br i1 %119, label %120, label %122
120: ; preds = %116, %108
%121 = call i32 @exit_error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %122
122: ; preds = %120, %116
%123 = load i32, i32* %10
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i32 %123)
%125 = load i8*, i8** %12
%126 = load i32, i32* %10
%127 = load i32*, i32** %7
%128 = call i32 @fwrite(i8* %125, i32 1, i32 %126, i32* %127)
%129 = load i32*, i32** %7
%130 = call i32 @fclose(i32* %129)
store i32 0, i32* %3
br label %131
131: ; preds = %122, %17
%132 = load i32, i32* %3
ret i32 %132
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [12 x i8] c"source file\00"
@.str.4 = [3 x i8] c"wb\00"
@.str.5 = [17 x i8] c"destination file\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.6 = [7 x i8] c"memory\00"
@.str.7 = [5 x i8] c"read\00"
@.str.8 = [8 x i8] c"inflate\00"
@.str.9 = [23 x i8] c"decompressed %u bytes\0A\00"
@str = [73 x i8] c"tgunzip - example from the tiny inflate library (www.ibsensoftware.com)\0A\00"
@str.10 = [116 x i8] c"Syntax: tgunzip <source> <destination>\0A\0ABoth input and output are kept in memory, so do not use this on huge files.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
%6 = icmp slt i32 %0, 3
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([116 x i8], [116 x i8]* @str.10, i64 0, i64 0))
br label %88
9: ; preds = %2
%10 = tail call i32 (...) @tinf_init()
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32* @fopen(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = tail call i32 @exit_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %9
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32* @fopen(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = tail call i32 @exit_error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
br label %24
24: ; preds = %22, %17
%25 = load i32, i32* @SEEK_END
%26 = tail call i32 @fseek(i32* %13, i32 0, i32 %25)
%27 = tail call i32 @ftell(i32* %13)
%28 = load i32, i32* @SEEK_SET
%29 = tail call i32 @fseek(i32* %13, i32 0, i32 %28)
%30 = tail call i64 @malloc(i32 %27)
%31 = inttoptr i64 %30 to i8*
%32 = icmp eq i64 %30, 0
br i1 %32, label %33, label %35
33: ; preds = %24
%34 = tail call i32 @exit_error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %35
35: ; preds = %33, %24
%36 = tail call i32 @fread(i8* %31, i32 1, i32 %27, i32* %13)
%37 = icmp eq i32 %36, %27
br i1 %37, label %40, label %38
38: ; preds = %35
%39 = tail call i32 @exit_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %40
40: ; preds = %38, %35
%41 = tail call i32 @fclose(i32* %13)
%42 = add i32 %27, -1
%43 = zext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %31, i64 %43
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = add i32 %27, -2
%48 = zext i32 %47 to i64
%49 = getelementptr inbounds i8, i8* %31, i64 %48
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = shl nuw nsw i32 %46, 16
%53 = shl nuw nsw i32 %51, 8
%54 = or i32 %53, %52
%55 = add i32 %27, -3
%56 = zext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %31, i64 %56
%58 = load i8, i8* %57
%59 = zext i8 %58 to i32
%60 = or i32 %54, %59
%61 = shl nuw i32 %60, 8
%62 = add i32 %27, -4
%63 = zext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %31, i64 %63
%65 = load i8, i8* %64
%66 = zext i8 %65 to i32
%67 = or i32 %61, %66
%68 = tail call i64 @malloc(i32 %67)
%69 = inttoptr i64 %68 to i8*
%70 = icmp eq i64 %68, 0
br i1 %70, label %71, label %73
71: ; preds = %40
%72 = tail call i32 @exit_error(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %73
73: ; preds = %71, %40
store i32 %67, i32* %3
%74 = call i32 @tinf_gzip_uncompress(i8* %69, i32* %3, i8* %31, i32 %27)
%75 = icmp eq i32 %74, 0
%76 = load i32, i32* %3
%77 = icmp eq i32 %76, %67
%78 = select i1 %75, i1 %77, i1 false
br i1 %78, label %82, label %79
79: ; preds = %73
%80 = call i32 @exit_error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%81 = load i32, i32* %3
br label %82
82: ; preds = %73, %79
%83 = phi i32 [ %67, %73 ], [ %81, %79 ]
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i32 %83)
%85 = load i32, i32* %3
%86 = call i32 @fwrite(i8* %69, i32 1, i32 %85, i32* %20)
%87 = call i32 @fclose(i32* %20)
br label %88
88: ; preds = %82, %7
%89 = phi i32 [ 1, %7 ], [ 0, %82 ]
ret i32 %89
}