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

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
unsigned char getc(int /*<<< orphan*/ *);
scalar_t__ getenv(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char *argv[]) {
  FILE *infile, *outfile;
  char infname[1024];
  char outfname[1024];
  char *rt28xxdir;
  char *chipset;
  int i = 0;
  unsigned char c;
  memset(infname, 0, 1024);
  memset(outfname, 0, 1024);
  rt28xxdir = (char *)getenv("RT28xx_DIR");
  chipset = (char *)getenv("CHIPSET");
  if (!rt28xxdir) {
    printf("Environment value \"RT28xx_DIR\" not export \n");
    return -1;
  }
  if (!chipset) {
    printf("Environment value \"CHIPSET\" not export \n");
    return -1;
  }
  if (strlen(rt28xxdir) > (sizeof(infname) - 100)) {
    printf("Environment value \"RT28xx_DIR\" is too long!\n");
    return -1;
  }
  strcat(infname, rt28xxdir);
  if (strncmp(chipset, "2860", 4) == 0)
    strcat(infname, "/common/rt2860.bin");
  else if (strncmp(chipset, "2870", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "3090", 4) == 0)
    strcat(infname, "/common/rt2860.bin");
  else if (strncmp(chipset, "2070", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "3070", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "3572", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "3370", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "USB", 3) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "PCI", 3) == 0)
    strcat(infname, "/common/rt2860.bin");
  else
    strcat(infname, "/common/rt2860.bin");
  strcat(outfname, rt28xxdir);
  strcat(outfname, "/include/firmware.h");
  infile = fopen(infname, "r");
  if (infile == (FILE *)NULL) {
    printf("Can't read file %s \n", infname);
    return -1;
  }
  outfile = fopen(outfname, "w");
  if (outfile == (FILE *)NULL) {
    printf("Can't open write file %s \n", outfname);
    return -1;
  }
  fputs("/*\n", outfile);
  fputs(" Copyright (c) 2007, Ralink Technology Corporation \n", outfile);
  fputs(" All rights reserved. \n\n", outfile);
  fputs(" Redistribution.  Redistribution and use in binary form, without \n",
        outfile);
  fputs(" modification, are permitted provided that the following conditions "
        "are \n",
        outfile);
  fputs(" met: \n\n", outfile);
  fputs(" \t* Redistributions must reproduce the above copyright notice and "
        "the \n",
        outfile);
  fputs(
      " \tfollowing disclaimer in the documentation and/or other materials \n",
      outfile);
  fputs(" \tprovided with the distribution. \n", outfile);
  fputs(" \t* Neither the name of Ralink Technology Corporation nor the names "
        "of its \n",
        outfile);
  fputs(" \tsuppliers may be used to endorse or promote products derived from "
        "this \n",
        outfile);
  fputs(" \tsoftware without specific prior written permission. \n", outfile);
  fputs(" \t* No reverse engineering, decompilation, or disassembly of this "
        "software \n",
        outfile);
  fputs(" \tis permitted. \n\n", outfile);
  fputs(" Limited patent license. Ralink Technology Corporation grants a "
        "world-wide, \n",
        outfile);
  fputs(" royalty-free, non-exclusive license under patents it now or "
        "hereafter \n",
        outfile);
  fputs(
      " owns or controls to make, have made, use, import, offer to sell and \n",
      outfile);
  fputs(
      " sell (\"Utilize\") this software, but solely to the extent that any \n",
      outfile);
  fputs(" such patent is necessary to Utilize the software alone, or in \n",
        outfile);
  fputs(" combination with an operating system licensed under an approved Open "
        "\n",
        outfile);
  fputs(" Source license as listed by the Open Source Initiative at \n",
        outfile);
  fputs(" http://opensource.org/licenses.  The patent license shall not apply "
        "to \n",
        outfile);
  fputs(" any other combinations which include this software.  No hardware per "
        "\n",
        outfile);
  fputs(" se is licensed hereunder. \n\n", outfile);
  fputs(
      " DISCLAIMER.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND \n",
      outfile);
  fputs(" CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, "
        "INCLUDING, \n",
        outfile);
  fputs(" BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND \n",
        outfile);
  fputs(" FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL "
        "THE \n",
        outfile);
  fputs(
      " COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, \n",
      outfile);
  fputs(" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, "
        "\n",
        outfile);
  fputs(" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; "
        "LOSS \n",
        outfile);
  fputs(" OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED "
        "AND \n",
        outfile);
  fputs(" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, "
        "OR \n",
        outfile);
  fputs(" TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF "
        "THE \n",
        outfile);
  fputs(" USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH \n",
        outfile);
  fputs(" DAMAGE. \n", outfile);
  fputs("*/ \n", outfile);
  fputs("/* AUTO GEN PLEASE DO NOT MODIFY IT */ \n", outfile);
  fputs("/* AUTO GEN PLEASE DO NOT MODIFY IT */ \n", outfile);
  fputs("\n", outfile);
  fputs("\n", outfile);
  fputs("UCHAR FirmwareImage [] = { \n", outfile);
  while (1) {
    char cc[3];
    c = getc(infile);
    if (feof(infile))
      break;
    memset(cc, 0, 2);
    if (i >= 16) {
      fputs("\n", outfile);
      i = 0;
    }
    fputs("0x", outfile);
    sprintf(cc, "%02x", c);
    fputs(cc, outfile);
    fputs(", ", outfile);
    i++;
  }
  fputs("} ;\n", outfile);
  fclose(infile);
  fclose(outfile);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x840,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x834(%rbp)
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1090 <memset@plt>
lea    -0x820(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1090 <memset@plt>
lea    0xde0(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x828(%rbp)
lea    0xdd8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x830(%rbp)
cmpq   $0x0,-0x828(%rbp)
jne    1267 <main+0x97>
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    194f <main+0x77f>
cmpq   $0x0,-0x830(%rbp)
jne    128f <main+0xbf>
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    194f <main+0x77f>
mov    -0x828(%rbp),%rdi
call   1060 <strlen@plt>
cltq
cmp    $0x39c,%rax
jbe    12c3 <main+0xf3>
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    194f <main+0x77f>
lea    -0x420(%rbp),%rdi
mov    -0x828(%rbp),%rsi
call   10c0 <strcat@plt>
mov    -0x830(%rbp),%rdi
lea    0xdb1(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1310 <main+0x140>
lea    -0x420(%rbp),%rdi
lea    0xd94(%rip),%rsi
call   10c0 <strcat@plt>
jmp    151b <main+0x34b>
mov    -0x830(%rbp),%rdi
lea    0xd8f(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    134a <main+0x17a>
lea    -0x420(%rbp),%rdi
lea    0xd72(%rip),%rsi
call   10c0 <strcat@plt>
jmp    1516 <main+0x346>
mov    -0x830(%rbp),%rdi
lea    0xd6d(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1384 <main+0x1b4>
lea    -0x420(%rbp),%rdi
lea    0xd20(%rip),%rsi
call   10c0 <strcat@plt>
jmp    1511 <main+0x341>
mov    -0x830(%rbp),%rdi
lea    0xd38(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    13be <main+0x1ee>
lea    -0x420(%rbp),%rdi
lea    0xcfe(%rip),%rsi
call   10c0 <strcat@plt>
jmp    150c <main+0x33c>
mov    -0x830(%rbp),%rdi
lea    0xd03(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    13f8 <main+0x228>
lea    -0x420(%rbp),%rdi
lea    0xcc4(%rip),%rsi
call   10c0 <strcat@plt>
jmp    1507 <main+0x337>
mov    -0x830(%rbp),%rdi
lea    0xcce(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1432 <main+0x262>
lea    -0x420(%rbp),%rdi
lea    0xc8a(%rip),%rsi
call   10c0 <strcat@plt>
jmp    1502 <main+0x332>
mov    -0x830(%rbp),%rdi
lea    0xc99(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    146c <main+0x29c>
lea    -0x420(%rbp),%rdi
lea    0xc50(%rip),%rsi
call   10c0 <strcat@plt>
jmp    14fd <main+0x32d>
mov    -0x830(%rbp),%rdi
lea    0xc64(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    14a6 <main+0x2d6>
lea    -0x420(%rbp),%rdi
lea    0xc16(%rip),%rsi
call   10c0 <strcat@plt>
jmp    14f8 <main+0x328>
mov    -0x830(%rbp),%rdi
lea    0xc2e(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    14e0 <main+0x310>
lea    -0x420(%rbp),%rdi
lea    0xbc4(%rip),%rsi
call   10c0 <strcat@plt>
jmp    14f3 <main+0x323>
lea    -0x420(%rbp),%rdi
lea    0xbac(%rip),%rsi
call   10c0 <strcat@plt>
jmp    14f8 <main+0x328>
jmp    14fd <main+0x32d>
jmp    1502 <main+0x332>
jmp    1507 <main+0x337>
jmp    150c <main+0x33c>
jmp    1511 <main+0x341>
jmp    1516 <main+0x346>
jmp    151b <main+0x34b>
lea    -0x820(%rbp),%rdi
mov    -0x828(%rbp),%rsi
call   10c0 <strcat@plt>
lea    -0x820(%rbp),%rdi
lea    0xbaa(%rip),%rsi
call   10c0 <strcat@plt>
lea    -0x420(%rbp),%rdi
lea    0xbab(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1584 <main+0x3b4>
lea    -0x420(%rbp),%rsi
lea    0xb8b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    194f <main+0x77f>
lea    -0x820(%rbp),%rdi
lea    0xb7f(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    15c7 <main+0x3f7>
lea    -0x820(%rbp),%rsi
lea    0xb5f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    194f <main+0x77f>
mov    -0x20(%rbp),%rsi
lea    0xb5c(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xb50(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xb75(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xb7e(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xbb1(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xbeb(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xbe4(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xc1c(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xc51(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xc65(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xca2(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xcdd(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xd05(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xd42(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xd45(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xd83(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xdbc(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xdf3(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xe28(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xe59(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xef8(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xf30(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xf3e(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xf75(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xfaf(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xfe4(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0x101e(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0x1055(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0x108d(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0x10c6(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0x1100(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0x1139(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0x1173(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0x11a7(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0x11c6(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0x1192(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0x1182(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xbb3(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xba3(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0x117b(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <getc@plt>
mov    %al,-0x835(%rbp)
mov    -0x18(%rbp),%rdi
call   10a0 <feof@plt>
cmp    $0x0,%rax
je     188e <main+0x6be>
jmp    1926 <main+0x756>
lea    -0x838(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1090 <memset@plt>
cmpl   $0x10,-0x834(%rbp)
jl     18c8 <main+0x6f8>
mov    -0x20(%rbp),%rsi
lea    0xb3c(%rip),%rdi
call   1080 <fputs@plt>
movl   $0x0,-0x834(%rbp)
mov    -0x20(%rbp),%rsi
lea    0x1127(%rip),%rdi
call   1080 <fputs@plt>
lea    -0x838(%rbp),%rdi
lea    0x1117(%rip),%rsi
movzbl -0x835(%rbp),%edx
call   10d0 <sprintf@plt>
lea    -0x838(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0x10f5(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x834(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x834(%rbp)
jmp    1867 <main+0x697>
mov    -0x20(%rbp),%rsi
lea    0x10d4(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x840,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x818,%rsp
lea    0x410(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   10a0 <memset@plt>
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   10a0 <memset@plt>
lea    0xdc3(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rbx
lea    0xdbf(%rip),%rdi
call   1030 <getenv@plt>
test   %rbx,%rbx
je     1276 <main+0x76>
mov    %rax,%r14
test   %rax,%rax
je     127f <main+0x7f>
mov    %rbx,%rdi
call   1070 <strlen@plt>
cmp    $0x39d,%eax
jb     12a2 <main+0xa2>
lea    0x1767(%rip),%rdi
jmp    1286 <main+0x86>
lea    0x170b(%rip),%rdi
jmp    1286 <main+0x86>
lea    0x172d(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffff,%eax
add    $0x818,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x410(%rsp),%rdi
mov    %rbx,%rsi
call   10e0 <strcat@plt>
lea    0xd5a(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
lea    0xd4b(%rip),%rbp
test   %rax,%rax
je     13a8 <main+0x1a8>
lea    0xd4e(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
lea    0xd3f(%rip),%r15
test   %rax,%rax
je     13ab <main+0x1ab>
lea    0xd42(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     13a8 <main+0x1a8>
lea    0xd2a(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     13ab <main+0x1ab>
lea    0xd16(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     13ab <main+0x1ab>
lea    0xd02(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     13ab <main+0x1ab>
lea    0xcee(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     13ab <main+0x1ab>
lea    0xcda(%rip),%rsi
mov    %r14,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     13ab <main+0x1ab>
lea    0xcc5(%rip),%rsi
mov    %r14,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
mov    %rbp,%r15
lea    0x410(%rsp),%r14
mov    %r14,%rdi
mov    %r15,%rsi
call   10e0 <strcat@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
call   10e0 <strcat@plt>
lea    0xc8f(%rip),%rsi
mov    %rbp,%rdi
call   10e0 <strcat@plt>
lea    0xc94(%rip),%rsi
mov    %r14,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     1418 <main+0x218>
mov    %rax,%rbx
lea    0xc94(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
jne    1433 <main+0x233>
lea    0xc80(%rip),%rdi
lea    0x10(%rsp),%rsi
jmp    1427 <main+0x227>
lea    0xc5b(%rip),%rdi
lea    0x410(%rsp),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    128b <main+0x8b>
mov    %rax,%r14
lea    0xc6f(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1110 <fwrite@plt>
lea    0xc5a(%rip),%rdi
mov    $0x34,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xc76(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xc76(%rip),%rdi
mov    $0x42,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xca0(%rip),%rdi
mov    $0x49,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xcd1(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xcc1(%rip),%rdi
mov    $0x47,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xcf0(%rip),%rdi
mov    $0x44,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xd1c(%rip),%rdi
mov    $0x23,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xd27(%rip),%rdi
mov    $0x4c,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xd5b(%rip),%rdi
mov    $0x4a,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xd8d(%rip),%rdi
mov    $0x37,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xdac(%rip),%rdi
mov    $0x4c,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xde0(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xdda(%rip),%rdi
mov    $0x4d,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xe0f(%rip),%rdi
mov    $0x48,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xe3f(%rip),%rdi
mov    $0x46,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xe6d(%rip),%rdi
mov    $0x44,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xe99(%rip),%rdi
mov    $0x40,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xec1(%rip),%rdi
mov    $0x47,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xef0(%rip),%rdi
mov    $0x3c,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xf14(%rip),%rdi
mov    $0x49,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xf45(%rip),%rdi
mov    $0x47,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xf74(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xf79(%rip),%rdi
mov    $0x46,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xfa7(%rip),%rdi
mov    $0x49,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0xfd8(%rip),%rdi
mov    $0x44,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0x1004(%rip),%rdi
mov    $0x49,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0x1035(%rip),%rdi
mov    $0x46,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0x1063(%rip),%rdi
mov    $0x47,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0x1092(%rip),%rdi
mov    $0x48,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0x10c2(%rip),%rdi
mov    $0x49,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0x10f3(%rip),%rdi
mov    $0x48,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0x1123(%rip),%rdi
mov    $0x49,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0x1154(%rip),%rdi
mov    $0x43,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0x117f(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0x1195(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
lea    0x1158(%rip),%rbp
mov    $0x28,%esi
mov    $0x1,%edx
mov    %rbp,%rdi
mov    %r14,%rcx
call   1110 <fwrite@plt>
mov    $0x28,%esi
mov    $0x1,%edx
mov    %rbp,%rdi
mov    %r14,%rcx
call   1110 <fwrite@plt>
mov    $0xa,%edi
mov    %r14,%rsi
call   10b0 <fputc@plt>
mov    $0xa,%edi
mov    %r14,%rsi
call   10b0 <fputc@plt>
lea    0x1136(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
mov    %rbx,%rdi
call   1120 <getc@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
call   10c0 <feof@plt>
test   %rax,%rax
jne    18f6 <main+0x6f6>
xor    %r13d,%r13d
lea    0xd(%rsp),%r15
lea    0x111e(%rip),%rbp
jmp    18cc <main+0x6cc>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0x1103(%rip),%rdi
mov    %r14,%rcx
call   1110 <fwrite@plt>
movzbl %r12b,%edx
mov    %r15,%rdi
lea    0x10f0(%rip),%rsi
call   10f0 <sprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1090 <fputs@plt>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbp,%rdi
mov    %r14,%rcx
call   1110 <fwrite@plt>
add    $0x1,%r13d
mov    %rbx,%rdi
call   1120 <getc@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
call   10c0 <feof@plt>
test   %rax,%rax
jne    18f6 <main+0x6f6>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   10a0 <memset@plt>
cmp    $0x10,%r13d
jl     1864 <main+0x664>
mov    $0xa,%edi
mov    %r14,%rsi
call   10b0 <fputc@plt>
xor    %r13d,%r13d
jmp    1864 <main+0x664>
lea    0x1086(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1110 <fwrite@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
mov    %r14,%rdi
call   1060 <fclose@plt>
xor    %edi,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"RT28xx_DIR\00"
@.str.1 = [8 x i8] c"CHIPSET\00"
@.str.2 = [44 x i8] c"Environment value \22RT28xx_DIR\22 not export \0A\00"
@.str.3 = [41 x i8] c"Environment value \22CHIPSET\22 not export \0A\00"
@.str.4 = [45 x i8] c"Environment value \22RT28xx_DIR\22 is too long!\0A\00"
@.str.5 = [5 x i8] c"2860\00"
@.str.6 = [19 x i8] c"/common/rt2860.bin\00"
@.str.7 = [5 x i8] c"2870\00"
@.str.8 = [19 x i8] c"/common/rt2870.bin\00"
@.str.9 = [5 x i8] c"3090\00"
@.str.10 = [5 x i8] c"2070\00"
@.str.11 = [5 x i8] c"3070\00"
@.str.12 = [5 x i8] c"3572\00"
@.str.13 = [5 x i8] c"3370\00"
@.str.14 = [4 x i8] c"USB\00"
@.str.15 = [4 x i8] c"PCI\00"
@.str.16 = [20 x i8] c"/include/firmware.h\00"
@.str.17 = [2 x i8] c"r\00"
@.str.18 = [21 x i8] c"Can't read file %s \0A\00"
@.str.19 = [2 x i8] c"w\00"
@.str.20 = [27 x i8] c"Can't open write file %s \0A\00"
@.str.21 = [4 x i8] c"/*\0A\00"
@.str.22 = [53 x i8] c" Copyright (c) 2007, Ralink Technology Corporation \0A\00"
@.str.23 = [25 x i8] c" All rights reserved. \0A\0A\00"
@.str.24 = [67 x i8] c" Redistribution. Redistribution and use in binary form, without \0A\00"
@.str.25 = [74 x i8] c" modification, are permitted provided that the following conditions are \0A\00"
@.str.26 = [9 x i8] c" met: \0A\0A\00"
@.str.27 = [72 x i8] c" \09* Redistributions must reproduce the above copyright notice and the \0A\00"
@.str.28 = [69 x i8] c" \09following disclaimer in the documentation and/or other materials \0A\00"
@.str.29 = [36 x i8] c" \09provided with the distribution. \0A\00"
@.str.30 = [77 x i8] c" \09* Neither the name of Ralink Technology Corporation nor the names of its \0A\00"
@.str.31 = [75 x i8] c" \09suppliers may be used to endorse or promote products derived from this \0A\00"
@.str.32 = [56 x i8] c" \09software without specific prior written permission. \0A\00"
@.str.33 = [77 x i8] c" \09* No reverse engineering, decompilation, or disassembly of this software \0A\00"
@.str.34 = [19 x i8] c" \09is permitted. \0A\0A\00"
@.str.35 = [78 x i8] c" Limited patent license. Ralink Technology Corporation grants a world-wide, \0A\00"
@.str.36 = [73 x i8] c" royalty-free, non-exclusive license under patents it now or hereafter \0A\00"
@.str.37 = [71 x i8] c" owns or controls to make, have made, use, import, offer to sell and \0A\00"
@.str.38 = [69 x i8] c" sell (\22Utilize\22) this software, but solely to the extent that any \0A\00"
@.str.39 = [65 x i8] c" such patent is necessary to Utilize the software alone, or in \0A\00"
@.str.40 = [72 x i8] c" combination with an operating system licensed under an approved Open \0A\00"
@.str.41 = [61 x i8] c" Source license as listed by the Open Source Initiative at \0A\00"
@.str.42 = [74 x i8] c" http://opensource.org/licenses. The patent license shall not apply to \0A\00"
@.str.43 = [72 x i8] c" any other combinations which include this software. No hardware per \0A\00"
@.str.44 = [30 x i8] c" se is licensed hereunder. \0A\0A\00"
@.str.45 = [71 x i8] c" DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND \0A\00"
@.str.46 = [74 x i8] c" CONTRIBUTORS \22AS IS\22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, \0A\00"
@.str.47 = [69 x i8] c" BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND \0A\00"
@.str.48 = [74 x i8] c" FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE \0A\00"
@.str.49 = [71 x i8] c" COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, \0A\00"
@.str.50 = [72 x i8] c" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \0A\00"
@.str.51 = [73 x i8] c" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS \0A\00"
@.str.52 = [74 x i8] c" OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND \0A\00"
@.str.53 = [73 x i8] c" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR \0A\00"
@.str.54 = [74 x i8] c" TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE \0A\00"
@.str.55 = [68 x i8] c" USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH \0A\00"
@.str.56 = [11 x i8] c" DAMAGE. \0A\00"
@.str.57 = [5 x i8] c"*/ \0A\00"
@.str.58 = [41 x i8] c"/* AUTO GEN PLEASE DO NOT MODIFY IT */ \0A\00"
@.str.59 = [2 x i8] c"\0A\00"
@.str.60 = [29 x i8] c"UCHAR FirmwareImage [] = { \0A\00"
@.str.61 = [3 x i8] c"0x\00"
@.str.62 = [5 x i8] c"%02x\00"
@.str.63 = [3 x i8] c", \00"
@.str.64 = [5 x i8] c"} ;\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 [1024 x i8]
%9 = alloca [1024 x i8]
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8
%14 = alloca [3 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %12
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%16 = call i32 @memset(i8* %15, i32 0, i32 1024)
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%18 = call i32 @memset(i8* %17, i32 0, i32 1024)
%19 = call i64 @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %10
%21 = call i64 @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%22 = inttoptr i64 %21 to i8*
store i8* %22, i8** %11
%23 = load i8*, i8** %10
%24 = icmp ne i8* %23, null
br i1 %24, label %27, label %25
25: ; preds = %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
store i32 -1, i32* %3
br label %258
27: ; preds = %2
%28 = load i8*, i8** %11
%29 = icmp ne i8* %28, null
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %3
br label %258
32: ; preds = %27
%33 = load i8*, i8** %10
%34 = call i32 @strlen(i8* %33)
%35 = sext i32 %34 to i64
%36 = icmp ugt i64 %35, 924
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0))
store i32 -1, i32* %3
br label %258
39: ; preds = %32
%40 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%41 = load i8*, i8** %10
%42 = call i32 @strcat(i8* %40, i8* %41)
%43 = load i8*, i8** %11
%44 = call i64 @strncmp(i8* %43, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %39
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%48 = call i32 @strcat(i8* %47, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %116
49: ; preds = %39
%50 = load i8*, i8** %11
%51 = call i64 @strncmp(i8* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %49
%54 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%55 = call i32 @strcat(i8* %54, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %115
56: ; preds = %49
%57 = load i8*, i8** %11
%58 = call i64 @strncmp(i8* %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 4)
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %63
60: ; preds = %56
%61 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%62 = call i32 @strcat(i8* %61, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %114
63: ; preds = %56
%64 = load i8*, i8** %11
%65 = call i64 @strncmp(i8* %64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %63
%68 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%69 = call i32 @strcat(i8* %68, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %113
70: ; preds = %63
%71 = load i8*, i8** %11
%72 = call i64 @strncmp(i8* %71, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 4)
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %77
74: ; preds = %70
%75 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%76 = call i32 @strcat(i8* %75, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %112
77: ; preds = %70
%78 = load i8*, i8** %11
%79 = call i64 @strncmp(i8* %78, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 4)
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %84
81: ; preds = %77
%82 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%83 = call i32 @strcat(i8* %82, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %111
84: ; preds = %77
%85 = load i8*, i8** %11
%86 = call i64 @strncmp(i8* %85, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i32 4)
%87 = icmp eq i64 %86, 0
br i1 %87, label %88, label %91
88: ; preds = %84
%89 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%90 = call i32 @strcat(i8* %89, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %110
91: ; preds = %84
%92 = load i8*, i8** %11
%93 = call i64 @strncmp(i8* %92, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 3)
%94 = icmp eq i64 %93, 0
br i1 %94, label %95, label %98
95: ; preds = %91
%96 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%97 = call i32 @strcat(i8* %96, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %109
98: ; preds = %91
%99 = load i8*, i8** %11
%100 = call i64 @strncmp(i8* %99, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 3)
%101 = icmp eq i64 %100, 0
br i1 %101, label %102, label %105
102: ; preds = %98
%103 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%104 = call i32 @strcat(i8* %103, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %108
105: ; preds = %98
%106 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%107 = call i32 @strcat(i8* %106, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %108
108: ; preds = %105, %102
br label %109
109: ; preds = %108, %95
br label %110
110: ; preds = %109, %88
br label %111
111: ; preds = %110, %81
br label %112
112: ; preds = %111, %74
br label %113
113: ; preds = %112, %67
br label %114
114: ; preds = %113, %60
br label %115
115: ; preds = %114, %53
br label %116
116: ; preds = %115, %46
%117 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%118 = load i8*, i8** %10
%119 = call i32 @strcat(i8* %117, i8* %118)
%120 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%121 = call i32 @strcat(i8* %120, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0))
%122 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%123 = call i32* @fopen(i8* %122, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
store i32* %123, i32** %6
%124 = load i32*, i32** %6
%125 = icmp eq i32* %124, null
br i1 %125, label %126, label %129
126: ; preds = %116
%127 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.18, i64 0, i64 0), i8* %127)
store i32 -1, i32* %3
br label %258
129: ; preds = %116
%130 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%131 = call i32* @fopen(i8* %130, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
store i32* %131, i32** %7
%132 = load i32*, i32** %7
%133 = icmp eq i32* %132, null
br i1 %133, label %134, label %137
134: ; preds = %129
%135 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.20, i64 0, i64 0), i8* %135)
store i32 -1, i32* %3
br label %258
137: ; preds = %129
%138 = load i32*, i32** %7
%139 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0), i32* %138)
%140 = load i32*, i32** %7
%141 = call i32 @fputs(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.22, i64 0, i64 0), i32* %140)
%142 = load i32*, i32** %7
%143 = call i32 @fputs(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.23, i64 0, i64 0), i32* %142)
%144 = load i32*, i32** %7
%145 = call i32 @fputs(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.24, i64 0, i64 0), i32* %144)
%146 = load i32*, i32** %7
%147 = call i32 @fputs(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.25, i64 0, i64 0), i32* %146)
%148 = load i32*, i32** %7
%149 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.26, i64 0, i64 0), i32* %148)
%150 = load i32*, i32** %7
%151 = call i32 @fputs(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.27, i64 0, i64 0), i32* %150)
%152 = load i32*, i32** %7
%153 = call i32 @fputs(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.28, i64 0, i64 0), i32* %152)
%154 = load i32*, i32** %7
%155 = call i32 @fputs(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.29, i64 0, i64 0), i32* %154)
%156 = load i32*, i32** %7
%157 = call i32 @fputs(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.30, i64 0, i64 0), i32* %156)
%158 = load i32*, i32** %7
%159 = call i32 @fputs(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.31, i64 0, i64 0), i32* %158)
%160 = load i32*, i32** %7
%161 = call i32 @fputs(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.32, i64 0, i64 0), i32* %160)
%162 = load i32*, i32** %7
%163 = call i32 @fputs(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.33, i64 0, i64 0), i32* %162)
%164 = load i32*, i32** %7
%165 = call i32 @fputs(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.34, i64 0, i64 0), i32* %164)
%166 = load i32*, i32** %7
%167 = call i32 @fputs(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.35, i64 0, i64 0), i32* %166)
%168 = load i32*, i32** %7
%169 = call i32 @fputs(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.36, i64 0, i64 0), i32* %168)
%170 = load i32*, i32** %7
%171 = call i32 @fputs(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.37, i64 0, i64 0), i32* %170)
%172 = load i32*, i32** %7
%173 = call i32 @fputs(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.38, i64 0, i64 0), i32* %172)
%174 = load i32*, i32** %7
%175 = call i32 @fputs(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.39, i64 0, i64 0), i32* %174)
%176 = load i32*, i32** %7
%177 = call i32 @fputs(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.40, i64 0, i64 0), i32* %176)
%178 = load i32*, i32** %7
%179 = call i32 @fputs(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.41, i64 0, i64 0), i32* %178)
%180 = load i32*, i32** %7
%181 = call i32 @fputs(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.42, i64 0, i64 0), i32* %180)
%182 = load i32*, i32** %7
%183 = call i32 @fputs(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.43, i64 0, i64 0), i32* %182)
%184 = load i32*, i32** %7
%185 = call i32 @fputs(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.44, i64 0, i64 0), i32* %184)
%186 = load i32*, i32** %7
%187 = call i32 @fputs(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.45, i64 0, i64 0), i32* %186)
%188 = load i32*, i32** %7
%189 = call i32 @fputs(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.46, i64 0, i64 0), i32* %188)
%190 = load i32*, i32** %7
%191 = call i32 @fputs(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.47, i64 0, i64 0), i32* %190)
%192 = load i32*, i32** %7
%193 = call i32 @fputs(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.48, i64 0, i64 0), i32* %192)
%194 = load i32*, i32** %7
%195 = call i32 @fputs(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.49, i64 0, i64 0), i32* %194)
%196 = load i32*, i32** %7
%197 = call i32 @fputs(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.50, i64 0, i64 0), i32* %196)
%198 = load i32*, i32** %7
%199 = call i32 @fputs(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.51, i64 0, i64 0), i32* %198)
%200 = load i32*, i32** %7
%201 = call i32 @fputs(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.52, i64 0, i64 0), i32* %200)
%202 = load i32*, i32** %7
%203 = call i32 @fputs(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.53, i64 0, i64 0), i32* %202)
%204 = load i32*, i32** %7
%205 = call i32 @fputs(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.54, i64 0, i64 0), i32* %204)
%206 = load i32*, i32** %7
%207 = call i32 @fputs(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.55, i64 0, i64 0), i32* %206)
%208 = load i32*, i32** %7
%209 = call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.56, i64 0, i64 0), i32* %208)
%210 = load i32*, i32** %7
%211 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.57, i64 0, i64 0), i32* %210)
%212 = load i32*, i32** %7
%213 = call i32 @fputs(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.58, i64 0, i64 0), i32* %212)
%214 = load i32*, i32** %7
%215 = call i32 @fputs(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.58, i64 0, i64 0), i32* %214)
%216 = load i32*, i32** %7
%217 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.59, i64 0, i64 0), i32* %216)
%218 = load i32*, i32** %7
%219 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.59, i64 0, i64 0), i32* %218)
%220 = load i32*, i32** %7
%221 = call i32 @fputs(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.60, i64 0, i64 0), i32* %220)
br label %222
222: ; preds = %137, %237
%223 = load i32*, i32** %6
%224 = call zeroext i8 @getc(i32* %223)
store i8 %224, i8* %13
%225 = load i32*, i32** %6
%226 = call i64 @feof(i32* %225)
%227 = icmp ne i64 %226, 0
br i1 %227, label %228, label %229
228: ; preds = %222
br label %250
229: ; preds = %222
%230 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%231 = call i32 @memset(i8* %230, i32 0, i32 2)
%232 = load i32, i32* %12
%233 = icmp sge i32 %232, 16
br i1 %233, label %234, label %237
234: ; preds = %229
%235 = load i32*, i32** %7
%236 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.59, i64 0, i64 0), i32* %235)
store i32 0, i32* %12
br label %237
237: ; preds = %234, %229
%238 = load i32*, i32** %7
%239 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.61, i64 0, i64 0), i32* %238)
%240 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%241 = load i8, i8* %13
%242 = call i32 @sprintf(i8* %240, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.62, i64 0, i64 0), i8 zeroext %241)
%243 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%244 = load i32*, i32** %7
%245 = call i32 @fputs(i8* %243, i32* %244)
%246 = load i32*, i32** %7
%247 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.63, i64 0, i64 0), i32* %246)
%248 = load i32, i32* %12
%249 = add nsw i32 %248, 1
store i32 %249, i32* %12
br label %222
250: ; preds = %228
%251 = load i32*, i32** %7
%252 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.64, i64 0, i64 0), i32* %251)
%253 = load i32*, i32** %6
%254 = call i32 @fclose(i32* %253)
%255 = load i32*, i32** %7
%256 = call i32 @fclose(i32* %255)
%257 = call i32 @exit(i32 0)
unreachable
258: ; preds = %134, %126, %37, %30, %25
%259 = load i32, i32* %3
ret i32 %259
}

LLVM IR (-O2):
@.str = [11 x i8] c"RT28xx_DIR\00"
@.str.1 = [8 x i8] c"CHIPSET\00"
@.str.5 = [5 x i8] c"2860\00"
@.str.6 = [19 x i8] c"/common/rt2860.bin\00"
@.str.7 = [5 x i8] c"2870\00"
@.str.8 = [19 x i8] c"/common/rt2870.bin\00"
@.str.9 = [5 x i8] c"3090\00"
@.str.10 = [5 x i8] c"2070\00"
@.str.11 = [5 x i8] c"3070\00"
@.str.12 = [5 x i8] c"3572\00"
@.str.13 = [5 x i8] c"3370\00"
@.str.14 = [4 x i8] c"USB\00"
@.str.15 = [4 x i8] c"PCI\00"
@.str.16 = [20 x i8] c"/include/firmware.h\00"
@.str.17 = [2 x i8] c"r\00"
@.str.18 = [21 x i8] c"Can't read file %s \0A\00"
@.str.19 = [2 x i8] c"w\00"
@.str.20 = [27 x i8] c"Can't open write file %s \0A\00"
@.str.21 = [4 x i8] c"/*\0A\00"
@.str.22 = [53 x i8] c" Copyright (c) 2007, Ralink Technology Corporation \0A\00"
@.str.23 = [25 x i8] c" All rights reserved. \0A\0A\00"
@.str.24 = [67 x i8] c" Redistribution. Redistribution and use in binary form, without \0A\00"
@.str.25 = [74 x i8] c" modification, are permitted provided that the following conditions are \0A\00"
@.str.26 = [9 x i8] c" met: \0A\0A\00"
@.str.27 = [72 x i8] c" \09* Redistributions must reproduce the above copyright notice and the \0A\00"
@.str.28 = [69 x i8] c" \09following disclaimer in the documentation and/or other materials \0A\00"
@.str.29 = [36 x i8] c" \09provided with the distribution. \0A\00"
@.str.30 = [77 x i8] c" \09* Neither the name of Ralink Technology Corporation nor the names of its \0A\00"
@.str.31 = [75 x i8] c" \09suppliers may be used to endorse or promote products derived from this \0A\00"
@.str.32 = [56 x i8] c" \09software without specific prior written permission. \0A\00"
@.str.33 = [77 x i8] c" \09* No reverse engineering, decompilation, or disassembly of this software \0A\00"
@.str.34 = [19 x i8] c" \09is permitted. \0A\0A\00"
@.str.35 = [78 x i8] c" Limited patent license. Ralink Technology Corporation grants a world-wide, \0A\00"
@.str.36 = [73 x i8] c" royalty-free, non-exclusive license under patents it now or hereafter \0A\00"
@.str.37 = [71 x i8] c" owns or controls to make, have made, use, import, offer to sell and \0A\00"
@.str.38 = [69 x i8] c" sell (\22Utilize\22) this software, but solely to the extent that any \0A\00"
@.str.39 = [65 x i8] c" such patent is necessary to Utilize the software alone, or in \0A\00"
@.str.40 = [72 x i8] c" combination with an operating system licensed under an approved Open \0A\00"
@.str.41 = [61 x i8] c" Source license as listed by the Open Source Initiative at \0A\00"
@.str.42 = [74 x i8] c" http://opensource.org/licenses. The patent license shall not apply to \0A\00"
@.str.43 = [72 x i8] c" any other combinations which include this software. No hardware per \0A\00"
@.str.44 = [30 x i8] c" se is licensed hereunder. \0A\0A\00"
@.str.45 = [71 x i8] c" DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND \0A\00"
@.str.46 = [74 x i8] c" CONTRIBUTORS \22AS IS\22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, \0A\00"
@.str.47 = [69 x i8] c" BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND \0A\00"
@.str.48 = [74 x i8] c" FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE \0A\00"
@.str.49 = [71 x i8] c" COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, \0A\00"
@.str.50 = [72 x i8] c" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \0A\00"
@.str.51 = [73 x i8] c" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS \0A\00"
@.str.52 = [74 x i8] c" OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND \0A\00"
@.str.53 = [73 x i8] c" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR \0A\00"
@.str.54 = [74 x i8] c" TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE \0A\00"
@.str.55 = [68 x i8] c" USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH \0A\00"
@.str.56 = [11 x i8] c" DAMAGE. \0A\00"
@.str.57 = [5 x i8] c"*/ \0A\00"
@.str.58 = [41 x i8] c"/* AUTO GEN PLEASE DO NOT MODIFY IT */ \0A\00"
@.str.60 = [29 x i8] c"UCHAR FirmwareImage [] = { \0A\00"
@.str.61 = [3 x i8] c"0x\00"
@.str.62 = [5 x i8] c"%02x\00"
@.str.63 = [3 x i8] c", \00"
@.str.64 = [5 x i8] c"} ;\0A\00"
@str = [43 x i8] c"Environment value \22RT28xx_DIR\22 not export \00"
@str.65 = [40 x i8] c"Environment value \22CHIPSET\22 not export \00"
@str.66 = [44 x i8] c"Environment value \22RT28xx_DIR\22 is too long!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = alloca [3 x i8]
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%8 = call i32 @memset(i8* %6, i32 0, i32 1024)
%9 = call i32 @memset(i8* %7, i32 0, i32 1024)
%10 = call i64 @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%11 = inttoptr i64 %10 to i8*
%12 = call i64 @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%13 = inttoptr i64 %12 to i8*
%14 = icmp eq i64 %10, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
br label %136
17: ; preds = %2
%18 = icmp eq i64 %12, 0
br i1 %18, label %19, label %21
19: ; preds = %17
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.65, i64 0, i64 0))
br label %136
21: ; preds = %17
%22 = call i32 @strlen(i8* %11)
%23 = icmp ugt i32 %22, 924
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.66, i64 0, i64 0))
br label %136
26: ; preds = %21
%27 = call i32 @strcat(i8* %6, i8* %11)
%28 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%29 = icmp eq i64 %28, 0
br i1 %29, label %53, label %30
30: ; preds = %26
%31 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%32 = icmp eq i64 %31, 0
br i1 %32, label %53, label %33
33: ; preds = %30
%34 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32 4)
%35 = icmp eq i64 %34, 0
br i1 %35, label %53, label %36
36: ; preds = %33
%37 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%38 = icmp eq i64 %37, 0
br i1 %38, label %53, label %39
39: ; preds = %36
%40 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 4)
%41 = icmp eq i64 %40, 0
br i1 %41, label %53, label %42
42: ; preds = %39
%43 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 4)
%44 = icmp eq i64 %43, 0
br i1 %44, label %53, label %45
45: ; preds = %42
%46 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i32 4)
%47 = icmp eq i64 %46, 0
br i1 %47, label %53, label %48
48: ; preds = %45
%49 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 3)
%50 = icmp eq i64 %49, 0
br i1 %50, label %53, label %51
51: ; preds = %48
%52 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i32 3)
br label %53
53: ; preds = %48, %45, %42, %39, %36, %33, %30, %26, %51
%54 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), %51 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), %26 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), %30 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), %33 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), %36 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), %39 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), %42 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), %45 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), %48 ]
%55 = call i32 @strcat(i8* %6, i8* %54)
%56 = call i32 @strcat(i8* %7, i8* %11)
%57 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0))
%58 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
%59 = icmp eq i32* %58, null
br i1 %59, label %60, label %62
60: ; preds = %53
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.18, i64 0, i64 0), i8* %6)
br label %136
62: ; preds = %53
%63 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%64 = icmp eq i32* %63, null
br i1 %64, label %65, label %67
65: ; preds = %62
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.20, i64 0, i64 0), i8* %7)
br label %136
67: ; preds = %62
%68 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0), i64 3, i64 1, i32* %63)
%69 = call i64 @fwrite(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.22, i64 0, i64 0), i64 52, i64 1, i32* %63)
%70 = call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.23, i64 0, i64 0), i64 24, i64 1, i32* %63)
%71 = call i64 @fwrite(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.24, i64 0, i64 0), i64 66, i64 1, i32* %63)
%72 = call i64 @fwrite(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.25, i64 0, i64 0), i64 73, i64 1, i32* %63)
%73 = call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.26, i64 0, i64 0), i64 8, i64 1, i32* %63)
%74 = call i64 @fwrite(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.27, i64 0, i64 0), i64 71, i64 1, i32* %63)
%75 = call i64 @fwrite(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.28, i64 0, i64 0), i64 68, i64 1, i32* %63)
%76 = call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.29, i64 0, i64 0), i64 35, i64 1, i32* %63)
%77 = call i64 @fwrite(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.30, i64 0, i64 0), i64 76, i64 1, i32* %63)
%78 = call i64 @fwrite(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.31, i64 0, i64 0), i64 74, i64 1, i32* %63)
%79 = call i64 @fwrite(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.32, i64 0, i64 0), i64 55, i64 1, i32* %63)
%80 = call i64 @fwrite(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.33, i64 0, i64 0), i64 76, i64 1, i32* %63)
%81 = call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.34, i64 0, i64 0), i64 18, i64 1, i32* %63)
%82 = call i64 @fwrite(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.35, i64 0, i64 0), i64 77, i64 1, i32* %63)
%83 = call i64 @fwrite(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.36, i64 0, i64 0), i64 72, i64 1, i32* %63)
%84 = call i64 @fwrite(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.37, i64 0, i64 0), i64 70, i64 1, i32* %63)
%85 = call i64 @fwrite(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.38, i64 0, i64 0), i64 68, i64 1, i32* %63)
%86 = call i64 @fwrite(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.39, i64 0, i64 0), i64 64, i64 1, i32* %63)
%87 = call i64 @fwrite(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.40, i64 0, i64 0), i64 71, i64 1, i32* %63)
%88 = call i64 @fwrite(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.41, i64 0, i64 0), i64 60, i64 1, i32* %63)
%89 = call i64 @fwrite(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.42, i64 0, i64 0), i64 73, i64 1, i32* %63)
%90 = call i64 @fwrite(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.43, i64 0, i64 0), i64 71, i64 1, i32* %63)
%91 = call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.44, i64 0, i64 0), i64 29, i64 1, i32* %63)
%92 = call i64 @fwrite(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.45, i64 0, i64 0), i64 70, i64 1, i32* %63)
%93 = call i64 @fwrite(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.46, i64 0, i64 0), i64 73, i64 1, i32* %63)
%94 = call i64 @fwrite(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.47, i64 0, i64 0), i64 68, i64 1, i32* %63)
%95 = call i64 @fwrite(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.48, i64 0, i64 0), i64 73, i64 1, i32* %63)
%96 = call i64 @fwrite(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.49, i64 0, i64 0), i64 70, i64 1, i32* %63)
%97 = call i64 @fwrite(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.50, i64 0, i64 0), i64 71, i64 1, i32* %63)
%98 = call i64 @fwrite(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.51, i64 0, i64 0), i64 72, i64 1, i32* %63)
%99 = call i64 @fwrite(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.52, i64 0, i64 0), i64 73, i64 1, i32* %63)
%100 = call i64 @fwrite(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.53, i64 0, i64 0), i64 72, i64 1, i32* %63)
%101 = call i64 @fwrite(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.54, i64 0, i64 0), i64 73, i64 1, i32* %63)
%102 = call i64 @fwrite(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.55, i64 0, i64 0), i64 67, i64 1, i32* %63)
%103 = call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.56, i64 0, i64 0), i64 10, i64 1, i32* %63)
%104 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.57, i64 0, i64 0), i64 4, i64 1, i32* %63)
%105 = call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.58, i64 0, i64 0), i64 40, i64 1, i32* %63)
%106 = call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.58, i64 0, i64 0), i64 40, i64 1, i32* %63)
%107 = call i32 @fputc(i32 10, i32* %63)
%108 = call i32 @fputc(i32 10, i32* %63)
%109 = call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.60, i64 0, i64 0), i64 28, i64 1, i32* %63)
%110 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%111 = call zeroext i8 @getc(i32* %58)
%112 = call i64 @feof(i32* %58)
%113 = icmp eq i64 %112, 0
br i1 %113, label %114, label %131
114: ; preds = %67, %121
%115 = phi i8 [ %128, %121 ], [ %111, %67 ]
%116 = phi i32 [ %127, %121 ], [ 0, %67 ]
%117 = call i32 @memset(i8* %110, i32 0, i32 2)
%118 = icmp sgt i32 %116, 15
br i1 %118, label %119, label %121
119: ; preds = %114
%120 = call i32 @fputc(i32 10, i32* %63)
br label %121
121: ; preds = %114, %119
%122 = phi i32 [ 0, %119 ], [ %116, %114 ]
%123 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.61, i64 0, i64 0), i64 2, i64 1, i32* %63)
%124 = call i32 @sprintf(i8* %110, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.62, i64 0, i64 0), i8 zeroext %115)
%125 = call i32 @fputs(i8* %110, i32* %63)
%126 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.63, i64 0, i64 0), i64 2, i64 1, i32* %63)
%127 = add nsw i32 %122, 1
%128 = call zeroext i8 @getc(i32* %58)
%129 = call i64 @feof(i32* %58)
%130 = icmp eq i64 %129, 0
br i1 %130, label %114, label %131
131: ; preds = %121, %67
%132 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.64, i64 0, i64 0), i64 4, i64 1, i32* %63)
%133 = call i32 @fclose(i32* %58)
%134 = call i32 @fclose(i32* %63)
%135 = call i32 @exit(i32 0)
unreachable
136: ; preds = %65, %60, %24, %19, %15
ret i32 -1
}