#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, "3573", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "3370", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "5370", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "5572", 4) == 0)
    strcat(infname, "/common/rt2870.bin");
  else if (strncmp(chipset, "5592", 4) == 0)
    strcat(infname, "/common/rt2860.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("/* 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    17fb <main+0x62b>
cmpq   $0x0,-0x830(%rbp)
jne    128f <main+0xbf>
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    17fb <main+0x62b>
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    17fb <main+0x62b>
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    1617 <main+0x447>
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    1612 <main+0x442>
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    160d <main+0x43d>
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    1608 <main+0x438>
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    1603 <main+0x433>
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    15fe <main+0x42e>
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    15f9 <main+0x429>
mov    -0x830(%rbp),%rdi
lea    0xc64(%rip),%rsi
mov    $0x4,%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    15f4 <main+0x424>
mov    -0x830(%rbp),%rdi
lea    0xc2f(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    14e0 <main+0x310>
lea    -0x420(%rbp),%rdi
lea    0xbdc(%rip),%rsi
call   10c0 <strcat@plt>
jmp    15ef <main+0x41f>
mov    -0x830(%rbp),%rdi
lea    0xbfa(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    151a <main+0x34a>
lea    -0x420(%rbp),%rdi
lea    0xba2(%rip),%rsi
call   10c0 <strcat@plt>
jmp    15ea <main+0x41a>
mov    -0x830(%rbp),%rdi
lea    0xbc5(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1554 <main+0x384>
lea    -0x420(%rbp),%rdi
lea    0xb50(%rip),%rsi
call   10c0 <strcat@plt>
jmp    15e5 <main+0x415>
mov    -0x830(%rbp),%rdi
lea    0xb90(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    158e <main+0x3be>
lea    -0x420(%rbp),%rdi
lea    0xb2e(%rip),%rsi
call   10c0 <strcat@plt>
jmp    15e0 <main+0x410>
mov    -0x830(%rbp),%rdi
lea    0xb5a(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    15c8 <main+0x3f8>
lea    -0x420(%rbp),%rdi
lea    0xadc(%rip),%rsi
call   10c0 <strcat@plt>
jmp    15db <main+0x40b>
lea    -0x420(%rbp),%rdi
lea    0xac4(%rip),%rsi
call   10c0 <strcat@plt>
jmp    15e0 <main+0x410>
jmp    15e5 <main+0x415>
jmp    15ea <main+0x41a>
jmp    15ef <main+0x41f>
jmp    15f4 <main+0x424>
jmp    15f9 <main+0x429>
jmp    15fe <main+0x42e>
jmp    1603 <main+0x433>
jmp    1608 <main+0x438>
jmp    160d <main+0x43d>
jmp    1612 <main+0x442>
jmp    1617 <main+0x447>
lea    -0x820(%rbp),%rdi
mov    -0x828(%rbp),%rsi
call   10c0 <strcat@plt>
lea    -0x820(%rbp),%rdi
lea    0xac2(%rip),%rsi
call   10c0 <strcat@plt>
lea    -0x420(%rbp),%rdi
lea    0xac3(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1680 <main+0x4b0>
lea    -0x420(%rbp),%rsi
lea    0xaa3(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    17fb <main+0x62b>
lea    -0x820(%rbp),%rdi
lea    0xa97(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    16c3 <main+0x4f3>
lea    -0x820(%rbp),%rsi
lea    0xa77(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    17fb <main+0x62b>
mov    -0x20(%rbp),%rsi
lea    0xa74(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xa64(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xa7b(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xa6b(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x20(%rbp),%rsi
lea    0xa5d(%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     173a <main+0x56a>
jmp    17d2 <main+0x602>
lea    -0x838(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1090 <memset@plt>
cmpl   $0x10,-0x834(%rbp)
jl     1774 <main+0x5a4>
mov    -0x20(%rbp),%rsi
lea    0xa04(%rip),%rdi
call   1080 <fputs@plt>
movl   $0x0,-0x834(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xa09(%rip),%rdi
call   1080 <fputs@plt>
lea    -0x838(%rbp),%rdi
lea    0x9f9(%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    0x9d7(%rip),%rdi
call   1080 <fputs@plt>
mov    -0x834(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x834(%rbp)
jmp    1713 <main+0x543>
mov    -0x20(%rbp),%rsi
lea    0x9b6(%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    0xef5(%rip),%rdi
jmp    1286 <main+0x86>
lea    0xe99(%rip),%rdi
jmp    1286 <main+0x86>
lea    0xebb(%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     141c <main+0x21c>
lea    0xd4e(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
lea    0xd3f(%rip),%r15
test   %rax,%rax
je     141f <main+0x21f>
lea    0xd42(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     141c <main+0x21c>
lea    0xd2a(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     141f <main+0x21f>
lea    0xd12(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     141f <main+0x21f>
lea    0xcfa(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     141f <main+0x21f>
lea    0xce2(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     141f <main+0x21f>
lea    0xcca(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     141f <main+0x21f>
lea    0xcb6(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     141f <main+0x21f>
lea    0xca2(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     141f <main+0x21f>
lea    0xc8e(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     141c <main+0x21c>
lea    0xc7a(%rip),%rsi
mov    %r14,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     141f <main+0x21f>
lea    0xc65(%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    0xc2f(%rip),%rsi
mov    %rbp,%rdi
call   10e0 <strcat@plt>
lea    0xc34(%rip),%rsi
mov    %r14,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     148c <main+0x28c>
mov    %rax,%rbx
lea    0xc34(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
jne    14a7 <main+0x2a7>
lea    0xc20(%rip),%rdi
lea    0x10(%rsp),%rsi
jmp    149b <main+0x29b>
lea    0xbfb(%rip),%rdi
lea    0x410(%rsp),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    128b <main+0x8b>
mov    %rax,%r14
lea    0xc0f(%rip),%rbp
mov    $0x28,%esi
mov    $0x1,%edx
mov    %rbp,%rdi
mov    %rax,%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    0xbed(%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    15cd <main+0x3cd>
xor    %r13d,%r13d
lea    0xd(%rsp),%r15
lea    0xbd5(%rip),%rbp
jmp    15a3 <main+0x3a3>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xbba(%rip),%rdi
mov    %r14,%rcx
call   1110 <fwrite@plt>
movzbl %r12b,%edx
mov    %r15,%rdi
lea    0xba7(%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    15cd <main+0x3cd>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   10a0 <memset@plt>
cmp    $0x10,%r13d
jl     153b <main+0x33b>
mov    $0xa,%edi
mov    %r14,%rsi
call   10b0 <fputc@plt>
xor    %r13d,%r13d
jmp    153b <main+0x33b>
lea    0xb3d(%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"3573\00"
@.str.14 = [5 x i8] c"3370\00"
@.str.15 = [5 x i8] c"5370\00"
@.str.16 = [5 x i8] c"5572\00"
@.str.17 = [5 x i8] c"5592\00"
@.str.18 = [4 x i8] c"USB\00"
@.str.19 = [4 x i8] c"PCI\00"
@.str.20 = [20 x i8] c"/include/firmware.h\00"
@.str.21 = [2 x i8] c"r\00"
@.str.22 = [21 x i8] c"Can't read file %s \0A\00"
@.str.23 = [2 x i8] c"w\00"
@.str.24 = [27 x i8] c"Can't open write file %s \0A\00"
@.str.25 = [41 x i8] c"/* AUTO GEN PLEASE DO NOT MODIFY IT */ \0A\00"
@.str.26 = [2 x i8] c"\0A\00"
@.str.27 = [29 x i8] c"UCHAR FirmwareImage [] = { \0A\00"
@.str.28 = [3 x i8] c"0x\00"
@.str.29 = [5 x i8] c"%02x\00"
@.str.30 = [3 x i8] c", \00"
@.str.31 = [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 %216
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 %216
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 %216
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 %148
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 %147
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 %146
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 %145
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 %144
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 %143
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 %142
91: ; preds = %84
%92 = load i8*, i8** %11
%93 = call i64 @strncmp(i8* %92, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i32 4)
%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 %141
98: ; preds = %91
%99 = load i8*, i8** %11
%100 = call i64 @strncmp(i8* %99, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i32 4)
%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.8, i64 0, i64 0))
br label %140
105: ; preds = %98
%106 = load i8*, i8** %11
%107 = call i64 @strncmp(i8* %106, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0), i32 4)
%108 = icmp eq i64 %107, 0
br i1 %108, label %109, label %112
109: ; preds = %105
%110 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%111 = call i32 @strcat(i8* %110, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %139
112: ; preds = %105
%113 = load i8*, i8** %11
%114 = call i64 @strncmp(i8* %113, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i32 4)
%115 = icmp eq i64 %114, 0
br i1 %115, label %116, label %119
116: ; preds = %112
%117 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%118 = call i32 @strcat(i8* %117, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %138
119: ; preds = %112
%120 = load i8*, i8** %11
%121 = call i64 @strncmp(i8* %120, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), i32 3)
%122 = icmp eq i64 %121, 0
br i1 %122, label %123, label %126
123: ; preds = %119
%124 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%125 = call i32 @strcat(i8* %124, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
br label %137
126: ; preds = %119
%127 = load i8*, i8** %11
%128 = call i64 @strncmp(i8* %127, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), i32 3)
%129 = icmp eq i64 %128, 0
br i1 %129, label %130, label %133
130: ; preds = %126
%131 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%132 = call i32 @strcat(i8* %131, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %136
133: ; preds = %126
%134 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%135 = call i32 @strcat(i8* %134, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
br label %136
136: ; preds = %133, %130
br label %137
137: ; preds = %136, %123
br label %138
138: ; preds = %137, %116
br label %139
139: ; preds = %138, %109
br label %140
140: ; preds = %139, %102
br label %141
141: ; preds = %140, %95
br label %142
142: ; preds = %141, %88
br label %143
143: ; preds = %142, %81
br label %144
144: ; preds = %143, %74
br label %145
145: ; preds = %144, %67
br label %146
146: ; preds = %145, %60
br label %147
147: ; preds = %146, %53
br label %148
148: ; preds = %147, %46
%149 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%150 = load i8*, i8** %10
%151 = call i32 @strcat(i8* %149, i8* %150)
%152 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%153 = call i32 @strcat(i8* %152, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i64 0, i64 0))
%154 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%155 = call i32* @fopen(i8* %154, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
store i32* %155, i32** %6
%156 = load i32*, i32** %6
%157 = icmp eq i32* %156, null
br i1 %157, label %158, label %161
158: ; preds = %148
%159 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.22, i64 0, i64 0), i8* %159)
store i32 -1, i32* %3
br label %216
161: ; preds = %148
%162 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%163 = call i32* @fopen(i8* %162, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
store i32* %163, i32** %7
%164 = load i32*, i32** %7
%165 = icmp eq i32* %164, null
br i1 %165, label %166, label %169
166: ; preds = %161
%167 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.24, i64 0, i64 0), i8* %167)
store i32 -1, i32* %3
br label %216
169: ; preds = %161
%170 = load i32*, i32** %7
%171 = call i32 @fputs(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.25, i64 0, i64 0), i32* %170)
%172 = load i32*, i32** %7
%173 = call i32 @fputs(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.25, i64 0, i64 0), i32* %172)
%174 = load i32*, i32** %7
%175 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.26, i64 0, i64 0), i32* %174)
%176 = load i32*, i32** %7
%177 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.26, i64 0, i64 0), i32* %176)
%178 = load i32*, i32** %7
%179 = call i32 @fputs(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.27, i64 0, i64 0), i32* %178)
br label %180
180: ; preds = %169, %195
%181 = load i32*, i32** %6
%182 = call zeroext i8 @getc(i32* %181)
store i8 %182, i8* %13
%183 = load i32*, i32** %6
%184 = call i64 @feof(i32* %183)
%185 = icmp ne i64 %184, 0
br i1 %185, label %186, label %187
186: ; preds = %180
br label %208
187: ; preds = %180
%188 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%189 = call i32 @memset(i8* %188, i32 0, i32 2)
%190 = load i32, i32* %12
%191 = icmp sge i32 %190, 16
br i1 %191, label %192, label %195
192: ; preds = %187
%193 = load i32*, i32** %7
%194 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.26, i64 0, i64 0), i32* %193)
store i32 0, i32* %12
br label %195
195: ; preds = %192, %187
%196 = load i32*, i32** %7
%197 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i64 0, i64 0), i32* %196)
%198 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%199 = load i8, i8* %13
%200 = call i32 @sprintf(i8* %198, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.29, i64 0, i64 0), i8 zeroext %199)
%201 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%202 = load i32*, i32** %7
%203 = call i32 @fputs(i8* %201, i32* %202)
%204 = load i32*, i32** %7
%205 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0), i32* %204)
%206 = load i32, i32* %12
%207 = add nsw i32 %206, 1
store i32 %207, i32* %12
br label %180
208: ; preds = %186
%209 = load i32*, i32** %7
%210 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.31, i64 0, i64 0), i32* %209)
%211 = load i32*, i32** %6
%212 = call i32 @fclose(i32* %211)
%213 = load i32*, i32** %7
%214 = call i32 @fclose(i32* %213)
%215 = call i32 @exit(i32 0)
unreachable
216: ; preds = %166, %158, %37, %30, %25
%217 = load i32, i32* %3
ret i32 %217
}

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"3573\00"
@.str.14 = [5 x i8] c"3370\00"
@.str.15 = [5 x i8] c"5370\00"
@.str.16 = [5 x i8] c"5572\00"
@.str.17 = [5 x i8] c"5592\00"
@.str.18 = [4 x i8] c"USB\00"
@.str.19 = [4 x i8] c"PCI\00"
@.str.20 = [20 x i8] c"/include/firmware.h\00"
@.str.21 = [2 x i8] c"r\00"
@.str.22 = [21 x i8] c"Can't read file %s \0A\00"
@.str.23 = [2 x i8] c"w\00"
@.str.24 = [27 x i8] c"Can't open write file %s \0A\00"
@.str.25 = [41 x i8] c"/* AUTO GEN PLEASE DO NOT MODIFY IT */ \0A\00"
@.str.27 = [29 x i8] c"UCHAR FirmwareImage [] = { \0A\00"
@.str.28 = [3 x i8] c"0x\00"
@.str.29 = [5 x i8] c"%02x\00"
@.str.30 = [3 x i8] c", \00"
@.str.31 = [5 x i8] c"} ;\0A\00"
@str = [43 x i8] c"Environment value \22RT28xx_DIR\22 not export \00"
@str.32 = [40 x i8] c"Environment value \22CHIPSET\22 not export \00"
@str.33 = [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 %111
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.32, i64 0, i64 0))
br label %111
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.33, i64 0, i64 0))
br label %111
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 %65, 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 %65, 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 %65, 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 %65, 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 %65, 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 %65, 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 %65, label %48
48: ; preds = %45
%49 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i32 4)
%50 = icmp eq i64 %49, 0
br i1 %50, label %65, label %51
51: ; preds = %48
%52 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i32 4)
%53 = icmp eq i64 %52, 0
br i1 %53, label %65, label %54
54: ; preds = %51
%55 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0), i32 4)
%56 = icmp eq i64 %55, 0
br i1 %56, label %65, label %57
57: ; preds = %54
%58 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i32 4)
%59 = icmp eq i64 %58, 0
br i1 %59, label %65, label %60
60: ; preds = %57
%61 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), i32 3)
%62 = icmp eq i64 %61, 0
br i1 %62, label %65, label %63
63: ; preds = %60
%64 = call i64 @strncmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), i32 3)
br label %65
65: ; preds = %60, %57, %54, %51, %48, %45, %42, %39, %36, %33, %30, %26, %63
%66 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), %63 ], [ 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 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), %51 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), %54 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), %57 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), %60 ]
%67 = call i32 @strcat(i8* %6, i8* %66)
%68 = call i32 @strcat(i8* %7, i8* %11)
%69 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i64 0, i64 0))
%70 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
%71 = icmp eq i32* %70, null
br i1 %71, label %72, label %74
72: ; preds = %65
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.22, i64 0, i64 0), i8* %6)
br label %111
74: ; preds = %65
%75 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%76 = icmp eq i32* %75, null
br i1 %76, label %77, label %79
77: ; preds = %74
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.24, i64 0, i64 0), i8* %7)
br label %111
79: ; preds = %74
%80 = call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.25, i64 0, i64 0), i64 40, i64 1, i32* %75)
%81 = call i64 @fwrite(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.25, i64 0, i64 0), i64 40, i64 1, i32* %75)
%82 = call i32 @fputc(i32 10, i32* %75)
%83 = call i32 @fputc(i32 10, i32* %75)
%84 = call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.27, i64 0, i64 0), i64 28, i64 1, i32* %75)
%85 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%86 = call zeroext i8 @getc(i32* %70)
%87 = call i64 @feof(i32* %70)
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %106
89: ; preds = %79, %96
%90 = phi i8 [ %103, %96 ], [ %86, %79 ]
%91 = phi i32 [ %102, %96 ], [ 0, %79 ]
%92 = call i32 @memset(i8* %85, i32 0, i32 2)
%93 = icmp sgt i32 %91, 15
br i1 %93, label %94, label %96
94: ; preds = %89
%95 = call i32 @fputc(i32 10, i32* %75)
br label %96
96: ; preds = %89, %94
%97 = phi i32 [ 0, %94 ], [ %91, %89 ]
%98 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i64 0, i64 0), i64 2, i64 1, i32* %75)
%99 = call i32 @sprintf(i8* %85, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.29, i64 0, i64 0), i8 zeroext %90)
%100 = call i32 @fputs(i8* %85, i32* %75)
%101 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.30, i64 0, i64 0), i64 2, i64 1, i32* %75)
%102 = add nsw i32 %97, 1
%103 = call zeroext i8 @getc(i32* %70)
%104 = call i64 @feof(i32* %70)
%105 = icmp eq i64 %104, 0
br i1 %105, label %89, label %106
106: ; preds = %96, %79
%107 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.31, i64 0, i64 0), i64 4, i64 1, i32* %75)
%108 = call i32 @fclose(i32* %70)
%109 = call i32 @fclose(i32* %75)
%110 = call i32 @exit(i32 0)
unreachable
111: ; preds = %77, %72, %24, %19, %15
ret i32 -1
}