#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 */
char *archdep_filename_parameter(char const *);
int archdep_spawn(char *, char **, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
char *archdep_tmpnam();
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
size_t fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ ioutil_remove(char *);
int /*<<< orphan*/ lib_free(char *);
char *lib_stralloc(char *);
char *try_uncompress_lynx(const char *name, int write_mode) {
  char *tmp_name;
  size_t i;
  int count;
  FILE *fd;
  char tmp[256];
  char *argv[20];
  int exit_status;
  fd = fopen(name, "r");
  if (fd == NULL)
    return NULL;
  i = fread(tmp, 1, 2, fd);
  if (i != 2 || tmp[0] != 1 || tmp[1] != 8) {
    fclose(fd);
    return NULL;
  }
  count = 0;
  while (1) {
    i = fread(tmp, 1, 1, fd);
    if (i != 1) {
      fclose(fd);
      return NULL;
    }
    if (tmp[0])
      count = 0;
    else
      count++;
    if (count == 3)
      break;
  }
  i = fread(tmp, 1, 1, fd);
  if (i != 1 || tmp[0] != 13) {
    fclose(fd);
    return NULL;
  }
  count = 0;
  while (1) {
    i = fread(&tmp[count], 1, 1, fd);
    if (i != 1 || count == 254) {
      fclose(fd);
      return NULL;
    }
    if (tmp[count++] == 13)
      break;
  }
  tmp[count] = 0;
  if (!atoi(tmp)) {
    fclose(fd);
    return NULL;
  }
  fclose(fd);
  if (write_mode)
    return "";
  tmp_name = archdep_tmpnam();
  argv[0] = lib_stralloc("c1541");
  argv[1] = lib_stralloc("-format");
  argv[2] = lib_stralloc("lynximage,00");
  argv[3] = lib_stralloc("x64");
  argv[4] = lib_stralloc(tmp_name);
  argv[5] = lib_stralloc("-unlynx");
  argv[6] = archdep_filename_parameter(name);
  argv[7] = NULL;
  exit_status = archdep_spawn("c1541", argv, NULL, NULL);
  lib_free(argv[0]);
  lib_free(argv[1]);
  lib_free(argv[2]);
  lib_free(argv[3]);
  lib_free(argv[4]);
  lib_free(argv[5]);
  lib_free(argv[6]);
  if (exit_status) {
    ioutil_remove(tmp_name);
    lib_free(tmp_name);
    return NULL;
  }
  return tmp_name;
}


x86 assembly (clang, -O0):
<try_uncompress_lynx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe43(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    11de <try_uncompress_lynx+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    1518 <try_uncompress_lynx+0x378>
lea    -0x140(%rbp),%rdi
mov    -0x38(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x2,-0x28(%rbp)
jne    1227 <try_uncompress_lynx+0x87>
movsbl -0x140(%rbp),%eax
cmp    $0x1,%eax
jne    1227 <try_uncompress_lynx+0x87>
movsbl -0x13f(%rbp),%eax
cmp    $0x8,%eax
je     123d <try_uncompress_lynx+0x9d>
mov    -0x38(%rbp),%rdi
call   1070 <fclose@plt>
movq   $0x0,-0x8(%rbp)
jmp    1518 <try_uncompress_lynx+0x378>
movl   $0x0,-0x2c(%rbp)
lea    -0x140(%rbp),%rdi
mov    -0x38(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x1,-0x28(%rbp)
je     1280 <try_uncompress_lynx+0xe0>
mov    -0x38(%rbp),%rdi
call   1070 <fclose@plt>
movq   $0x0,-0x8(%rbp)
jmp    1518 <try_uncompress_lynx+0x378>
cmpb   $0x0,-0x140(%rbp)
je     1299 <try_uncompress_lynx+0xf9>
movl   $0x0,-0x2c(%rbp)
jmp    12a2 <try_uncompress_lynx+0x102>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x3,-0x2c(%rbp)
jne    12b1 <try_uncompress_lynx+0x111>
jmp    12b6 <try_uncompress_lynx+0x116>
jmp    1244 <try_uncompress_lynx+0xa4>
lea    -0x140(%rbp),%rdi
mov    -0x38(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x1,-0x28(%rbp)
jne    12ec <try_uncompress_lynx+0x14c>
movsbl -0x140(%rbp),%eax
cmp    $0xd,%eax
je     1302 <try_uncompress_lynx+0x162>
mov    -0x38(%rbp),%rdi
call   1070 <fclose@plt>
movq   $0x0,-0x8(%rbp)
jmp    1518 <try_uncompress_lynx+0x378>
movl   $0x0,-0x2c(%rbp)
movslq -0x2c(%rbp),%rax
lea    -0x140(%rbp),%rdi
add    %rax,%rdi
mov    -0x38(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x1,-0x28(%rbp)
jne    1343 <try_uncompress_lynx+0x1a3>
cmpl   $0xfe,-0x2c(%rbp)
jne    1359 <try_uncompress_lynx+0x1b9>
mov    -0x38(%rbp),%rdi
call   1070 <fclose@plt>
movq   $0x0,-0x8(%rbp)
jmp    1518 <try_uncompress_lynx+0x378>
mov    -0x2c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x2c(%rbp)
cltq
movsbl -0x140(%rbp,%rax,1),%eax
ff
cmp    $0xd,%eax
jne    137c <try_uncompress_lynx+0x1dc>
jmp    1381 <try_uncompress_lynx+0x1e1>
jmp    1309 <try_uncompress_lynx+0x169>
movslq -0x2c(%rbp),%rax
movb   $0x0,-0x140(%rbp,%rax,1)
lea    -0x140(%rbp),%rdi
call   10c0 <atoi@plt>
cmp    $0x0,%eax
jne    13b8 <try_uncompress_lynx+0x218>
mov    -0x38(%rbp),%rdi
call   1070 <fclose@plt>
movq   $0x0,-0x8(%rbp)
jmp    1518 <try_uncompress_lynx+0x378>
mov    -0x38(%rbp),%rdi
call   1070 <fclose@plt>
cmpl   $0x0,-0x14(%rbp)
je     13db <try_uncompress_lynx+0x23b>
lea    0xc4a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1518 <try_uncompress_lynx+0x378>
mov    $0x0,%al
call   10a0 <archdep_tmpnam@plt>
mov    %rax,-0x20(%rbp)
lea    0xc15(%rip),%rdi
call   1050 <lib_stralloc@plt>
mov    %rax,-0x1e0(%rbp)
lea    0xc08(%rip),%rdi
call   1050 <lib_stralloc@plt>
mov    %rax,-0x1d8(%rbp)
lea    0xbfd(%rip),%rdi
call   1050 <lib_stralloc@plt>
mov    %rax,-0x1d0(%rbp)
lea    0xbf7(%rip),%rdi
call   1050 <lib_stralloc@plt>
mov    %rax,-0x1c8(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <lib_stralloc@plt>
mov    %rax,-0x1c0(%rbp)
lea    0xbd8(%rip),%rdi
call   1050 <lib_stralloc@plt>
mov    %rax,-0x1b8(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <archdep_filename_parameter@plt>
mov    %rax,-0x1b0(%rbp)
movq   $0x0,-0x1a8(%rbp)
lea    -0x1e0(%rbp),%rsi
lea    0xb84(%rip),%rdi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1080 <archdep_spawn@plt>
mov    %eax,-0x1e4(%rbp)
mov    -0x1e0(%rbp),%rdi
call   1060 <lib_free@plt>
mov    -0x1d8(%rbp),%rdi
call   1060 <lib_free@plt>
mov    -0x1d0(%rbp),%rdi
call   1060 <lib_free@plt>
mov    -0x1c8(%rbp),%rdi
call   1060 <lib_free@plt>
mov    -0x1c0(%rbp),%rdi
call   1060 <lib_free@plt>
mov    -0x1b8(%rbp),%rdi
call   1060 <lib_free@plt>
mov    -0x1b0(%rbp),%rdi
call   1060 <lib_free@plt>
cmpl   $0x0,-0x1e4(%rbp)
je     1510 <try_uncompress_lynx+0x370>
mov    -0x20(%rbp),%rdi
call   1090 <ioutil_remove@plt>
mov    -0x20(%rbp),%rdi
call   1060 <lib_free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1518 <try_uncompress_lynx+0x378>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_uncompress_lynx>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a8,%rsp
mov    %esi,%r15d
mov    %rdi,%r14
lea    0xe42(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     12f6 <try_uncompress_lynx+0x156>
mov    %rax,%rbx
lea    0xa0(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
cmp    $0x2,%rax
jne    12ee <try_uncompress_lynx+0x14e>
cmpb   $0x1,0xa0(%rsp)
01
jne    12ee <try_uncompress_lynx+0x14e>
cmpb   $0x8,0xa1(%rsp)
08
jne    12ee <try_uncompress_lynx+0x14e>
xor    %r12d,%r12d
lea    0xa0(%rsp),%r13
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
cmp    $0x1,%rax
jne    12ee <try_uncompress_lynx+0x14e>
add    $0x1,%ebp
cmpb   $0x0,0xa0(%rsp)
cmovne %r12d,%ebp
cmp    $0x3,%ebp
jne    1220 <try_uncompress_lynx+0x80>
lea    0xa0(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
cmp    $0x1,%rax
jne    12ee <try_uncompress_lynx+0x14e>
cmpb   $0xd,0xa0(%rsp)
0d
jne    12ee <try_uncompress_lynx+0x14e>
xor    %ebp,%ebp
nop
lea    (%rsp,%rbp,1),%rdi
add    $0xa0,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
cmp    $0x1,%rax
jne    12ee <try_uncompress_lynx+0x14e>
cmp    $0xfe,%rbp
je     12ee <try_uncompress_lynx+0x14e>
lea    0x1(%rbp),%rax
cmpb   $0xd,0xa0(%rsp,%rbp,1)
0d
mov    %rax,%rbp
jne    1280 <try_uncompress_lynx+0xe0>
movb   $0x0,0xa0(%rsp,%rax,1)
lea    0xa0(%rsp),%rdi
call   10c0 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1070 <fclose@plt>
test   %ebp,%ebp
je     12f6 <try_uncompress_lynx+0x156>
test   %r15d,%r15d
je     130d <try_uncompress_lynx+0x16d>
lea    0xd30(%rip),%rbx
jmp    12f8 <try_uncompress_lynx+0x158>
mov    %rbx,%rdi
call   1070 <fclose@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x1a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   10a0 <archdep_tmpnam@plt>
mov    %rax,%rbx
lea    0xce4(%rip),%rbp
mov    %rbp,%rdi
call   1050 <lib_stralloc@plt>
mov    %rax,(%rsp)
lea    0xcd7(%rip),%rdi
call   1050 <lib_stralloc@plt>
mov    %rax,0x8(%rsp)
lea    0xcce(%rip),%rdi
call   1050 <lib_stralloc@plt>
mov    %rax,0x10(%rsp)
lea    0xcca(%rip),%rdi
call   1050 <lib_stralloc@plt>
mov    %rax,0x18(%rsp)
mov    %rbx,%rdi
call   1050 <lib_stralloc@plt>
mov    %rax,0x20(%rsp)
lea    0xcb0(%rip),%rdi
call   1050 <lib_stralloc@plt>
mov    %rax,0x28(%rsp)
mov    %r14,%rdi
call   1040 <archdep_filename_parameter@plt>
mov    %rax,0x30(%rsp)
movq   $0x0,0x38(%rsp)
mov    %rsp,%rsi
mov    %rbp,%rdi
xor    %edx,%edx
xor    %ecx,%ecx
call   1080 <archdep_spawn@plt>
mov    %eax,%ebp
mov    (%rsp),%rdi
call   1060 <lib_free@plt>
mov    0x8(%rsp),%rdi
call   1060 <lib_free@plt>
mov    0x10(%rsp),%rdi
call   1060 <lib_free@plt>
mov    0x18(%rsp),%rdi
call   1060 <lib_free@plt>
mov    0x20(%rsp),%rdi
call   1060 <lib_free@plt>
mov    0x28(%rsp),%rdi
call   1060 <lib_free@plt>
mov    0x30(%rsp),%rdi
call   1060 <lib_free@plt>
test   %ebp,%ebp
je     12f8 <try_uncompress_lynx+0x158>
mov    %rbx,%rdi
call   1090 <ioutil_remove@plt>
mov    %rbx,%rdi
call   1060 <lib_free@plt>
jmp    12f6 <try_uncompress_lynx+0x156>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"c1541\00"
@.str.3 = [8 x i8] c"-format\00"
@.str.4 = [13 x i8] c"lynximage,00\00"
@.str.5 = [4 x i8] c"x64\00"
@.str.6 = [8 x i8] c"-unlynx\00"
define i8* @try_uncompress_lynx(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32*
%10 = alloca [256 x i8]
%11 = alloca [20 x i8*]
%12 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%13 = load i8*, i8** %4
%14 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %14, i32** %9
%15 = load i32*, i32** %9
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %18
17: ; preds = %2
store i8* null, i8** %3
br label %166
18: ; preds = %2
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%20 = load i32*, i32** %9
%21 = call i64 @fread(i8* %19, i32 1, i32 2, i32* %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
%23 = icmp ne i64 %22, 2
br i1 %23, label %34, label %24
24: ; preds = %18
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 1
br i1 %28, label %34, label %29
29: ; preds = %24
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 1
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 8
br i1 %33, label %34, label %37
34: ; preds = %29, %24, %18
%35 = load i32*, i32** %9
%36 = call i32 @fclose(i32* %35)
store i8* null, i8** %3
br label %166
37: ; preds = %29
store i32 0, i32* %8
br label %38
38: ; preds = %37, %59
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%40 = load i32*, i32** %9
%41 = call i64 @fread(i8* %39, i32 1, i32 1, i32* %40)
store i64 %41, i64* %7
%42 = load i64, i64* %7
%43 = icmp ne i64 %42, 1
br i1 %43, label %44, label %47
44: ; preds = %38
%45 = load i32*, i32** %9
%46 = call i32 @fclose(i32* %45)
store i8* null, i8** %3
br label %166
47: ; preds = %38
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%49 = load i8, i8* %48
%50 = icmp ne i8 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %47
store i32 0, i32* %8
br label %55
52: ; preds = %47
%53 = load i32, i32* %8
%54 = add nsw i32 %53, 1
store i32 %54, i32* %8
br label %55
55: ; preds = %52, %51
%56 = load i32, i32* %8
%57 = icmp eq i32 %56, 3
br i1 %57, label %58, label %59
58: ; preds = %55
br label %60
59: ; preds = %55
br label %38
60: ; preds = %58
%61 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%62 = load i32*, i32** %9
%63 = call i64 @fread(i8* %61, i32 1, i32 1, i32* %62)
store i64 %63, i64* %7
%64 = load i64, i64* %7
%65 = icmp ne i64 %64, 1
br i1 %65, label %71, label %66
66: ; preds = %60
%67 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp ne i32 %69, 13
br i1 %70, label %71, label %74
71: ; preds = %66, %60
%72 = load i32*, i32** %9
%73 = call i32 @fclose(i32* %72)
store i8* null, i8** %3
br label %166
74: ; preds = %66
store i32 0, i32* %8
br label %75
75: ; preds = %74, %98
%76 = load i32, i32* %8
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 %77
%79 = load i32*, i32** %9
%80 = call i64 @fread(i8* %78, i32 1, i32 1, i32* %79)
store i64 %80, i64* %7
%81 = load i64, i64* %7
%82 = icmp ne i64 %81, 1
br i1 %82, label %86, label %83
83: ; preds = %75
%84 = load i32, i32* %8
%85 = icmp eq i32 %84, 254
br i1 %85, label %86, label %89
86: ; preds = %83, %75
%87 = load i32*, i32** %9
%88 = call i32 @fclose(i32* %87)
store i8* null, i8** %3
br label %166
89: ; preds = %83
%90 = load i32, i32* %8
%91 = add nsw i32 %90, 1
store i32 %91, i32* %8
%92 = sext i32 %90 to i64
%93 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 %92
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 13
br i1 %96, label %97, label %98
97: ; preds = %89
br label %99
98: ; preds = %89
br label %75
99: ; preds = %97
%100 = load i32, i32* %8
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 %101
store i8 0, i8* %102
%103 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%104 = call i32 @atoi(i8* %103)
%105 = icmp ne i32 %104, 0
br i1 %105, label %109, label %106
106: ; preds = %99
%107 = load i32*, i32** %9
%108 = call i32 @fclose(i32* %107)
store i8* null, i8** %3
br label %166
109: ; preds = %99
%110 = load i32*, i32** %9
%111 = call i32 @fclose(i32* %110)
%112 = load i32, i32* %5
%113 = icmp ne i32 %112, 0
br i1 %113, label %114, label %115
114: ; preds = %109
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %166
115: ; preds = %109
%116 = call i8* (...) @archdep_tmpnam()
store i8* %116, i8** %6
%117 = call i8* @lib_stralloc(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%118 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 0
store i8* %117, i8** %118
%119 = call i8* @lib_stralloc(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%120 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 1
store i8* %119, i8** %120
%121 = call i8* @lib_stralloc(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%122 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 2
store i8* %121, i8** %122
%123 = call i8* @lib_stralloc(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%124 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 3
store i8* %123, i8** %124
%125 = load i8*, i8** %6
%126 = call i8* @lib_stralloc(i8* %125)
%127 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 4
store i8* %126, i8** %127
%128 = call i8* @lib_stralloc(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%129 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 5
store i8* %128, i8** %129
%130 = load i8*, i8** %4
%131 = call i8* @archdep_filename_parameter(i8* %130)
%132 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 6
store i8* %131, i8** %132
%133 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 7
store i8* null, i8** %133
%134 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 0
%135 = call i32 @archdep_spawn(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %134, i32* null, i32* null)
store i32 %135, i32* %12
%136 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 0
%137 = load i8*, i8** %136
%138 = call i32 @lib_free(i8* %137)
%139 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 1
%140 = load i8*, i8** %139
%141 = call i32 @lib_free(i8* %140)
%142 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 2
%143 = load i8*, i8** %142
%144 = call i32 @lib_free(i8* %143)
%145 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 3
%146 = load i8*, i8** %145
%147 = call i32 @lib_free(i8* %146)
%148 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 4
%149 = load i8*, i8** %148
%150 = call i32 @lib_free(i8* %149)
%151 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 5
%152 = load i8*, i8** %151
%153 = call i32 @lib_free(i8* %152)
%154 = getelementptr inbounds [20 x i8*], [20 x i8*]* %11, i64 0, i64 6
%155 = load i8*, i8** %154
%156 = call i32 @lib_free(i8* %155)
%157 = load i32, i32* %12
%158 = icmp ne i32 %157, 0
br i1 %158, label %159, label %164
159: ; preds = %115
%160 = load i8*, i8** %6
%161 = call i32 @ioutil_remove(i8* %160)
%162 = load i8*, i8** %6
%163 = call i32 @lib_free(i8* %162)
store i8* null, i8** %3
br label %166
164: ; preds = %115
%165 = load i8*, i8** %6
store i8* %165, i8** %3
br label %166
166: ; preds = %164, %159, %114, %106, %86, %71, %44, %34, %17
%167 = load i8*, i8** %3
ret i8* %167
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"c1541\00"
@.str.3 = [8 x i8] c"-format\00"
@.str.4 = [13 x i8] c"lynximage,00\00"
@.str.5 = [4 x i8] c"x64\00"
@.str.6 = [8 x i8] c"-unlynx\00"
define i8* @try_uncompress_lynx(i8* %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = alloca [20 x i8*]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = bitcast [20 x i8*]* %4 to i8*
%7 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %98, label %9
9: ; preds = %2
%10 = call i64 @fread(i8* %5, i32 1, i32 2, i32* %7)
%11 = icmp ne i64 %10, 2
%12 = load i8, i8* %5
%13 = icmp ne i8 %12, 1
%14 = select i1 %11, i1 true, i1 %13
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 1
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 8
%18 = select i1 %14, i1 true, i1 %17
br i1 %18, label %19, label %21
19: ; preds = %9
%20 = tail call i32 @fclose(i32* %7)
br label %98
21: ; preds = %9, %27
%22 = phi i32 [ %31, %27 ], [ 0, %9 ]
%23 = call i64 @fread(i8* %5, i32 1, i32 1, i32* %7)
%24 = icmp eq i64 %23, 1
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = tail call i32 @fclose(i32* %7)
br label %98
27: ; preds = %21
%28 = load i8, i8* %5
%29 = icmp eq i8 %28, 0
%30 = add nsw i32 %22, 1
%31 = select i1 %29, i32 %30, i32 0
%32 = icmp eq i32 %31, 3
br i1 %32, label %33, label %21
33: ; preds = %27
%34 = call i64 @fread(i8* %5, i32 1, i32 1, i32* %7)
%35 = icmp ne i64 %34, 1
%36 = load i8, i8* %5
%37 = icmp ne i8 %36, 13
%38 = select i1 %35, i1 true, i1 %37
br i1 %38, label %39, label %41
39: ; preds = %33
%40 = tail call i32 @fclose(i32* %7)
br label %98
41: ; preds = %33, %50
%42 = phi i64 [ %51, %50 ], [ 0, %33 ]
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %42
%44 = call i64 @fread(i8* %43, i32 1, i32 1, i32* %7)
%45 = icmp ne i64 %44, 1
%46 = icmp eq i64 %42, 254
%47 = select i1 %45, i1 true, i1 %46
br i1 %47, label %48, label %50
48: ; preds = %41
%49 = tail call i32 @fclose(i32* %7)
br label %98
50: ; preds = %41
%51 = add nuw nsw i64 %42, 1
%52 = load i8, i8* %43
%53 = icmp eq i8 %52, 13
br i1 %53, label %54, label %41
54: ; preds = %50
%55 = and i64 %51, 4294967295
%56 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %55
store i8 0, i8* %56
%57 = call i32 @atoi(i8* %5)
%58 = icmp eq i32 %57, 0
%59 = tail call i32 @fclose(i32* %7)
br i1 %58, label %98, label %60
60: ; preds = %54
%61 = icmp eq i32 %1, 0
br i1 %61, label %62, label %98
62: ; preds = %60
%63 = tail call i8* (...) @archdep_tmpnam()
%64 = tail call i8* @lib_stralloc(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%65 = getelementptr inbounds [20 x i8*], [20 x i8*]* %4, i64 0, i64 0
store i8* %64, i8** %65
%66 = tail call i8* @lib_stralloc(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%67 = getelementptr inbounds [20 x i8*], [20 x i8*]* %4, i64 0, i64 1
store i8* %66, i8** %67
%68 = tail call i8* @lib_stralloc(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%69 = getelementptr inbounds [20 x i8*], [20 x i8*]* %4, i64 0, i64 2
store i8* %68, i8** %69
%70 = tail call i8* @lib_stralloc(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%71 = getelementptr inbounds [20 x i8*], [20 x i8*]* %4, i64 0, i64 3
store i8* %70, i8** %71
%72 = tail call i8* @lib_stralloc(i8* %63)
%73 = getelementptr inbounds [20 x i8*], [20 x i8*]* %4, i64 0, i64 4
store i8* %72, i8** %73
%74 = tail call i8* @lib_stralloc(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%75 = getelementptr inbounds [20 x i8*], [20 x i8*]* %4, i64 0, i64 5
store i8* %74, i8** %75
%76 = tail call i8* @archdep_filename_parameter(i8* %0)
%77 = getelementptr inbounds [20 x i8*], [20 x i8*]* %4, i64 0, i64 6
store i8* %76, i8** %77
%78 = getelementptr inbounds [20 x i8*], [20 x i8*]* %4, i64 0, i64 7
store i8* null, i8** %78
%79 = call i32 @archdep_spawn(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %65, i32* null, i32* null)
%80 = load i8*, i8** %65
%81 = call i32 @lib_free(i8* %80)
%82 = load i8*, i8** %67
%83 = call i32 @lib_free(i8* %82)
%84 = load i8*, i8** %69
%85 = call i32 @lib_free(i8* %84)
%86 = load i8*, i8** %71
%87 = call i32 @lib_free(i8* %86)
%88 = load i8*, i8** %73
%89 = call i32 @lib_free(i8* %88)
%90 = load i8*, i8** %75
%91 = call i32 @lib_free(i8* %90)
%92 = load i8*, i8** %77
%93 = call i32 @lib_free(i8* %92)
%94 = icmp eq i32 %79, 0
br i1 %94, label %98, label %95
95: ; preds = %62
%96 = call i32 @ioutil_remove(i8* %63)
%97 = call i32 @lib_free(i8* %63)
br label %98
98: ; preds = %54, %62, %60, %2, %95, %48, %39, %25, %19
%99 = phi i8* [ null, %19 ], [ null, %25 ], [ null, %39 ], [ null, %48 ], [ null, %95 ], [ null, %2 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %60 ], [ %63, %62 ], [ null, %54 ]
ret i8* %99
}