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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int frame_length(char *, int, int, int *, int *);
char *malloc(size_t);
int /*<<< orphan*/ memmove(char *, char *, int);
int read_buf(char *, int, char *, int);
scalar_t__ sscanf(char *const, char *, int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcmp(char *const, char *);
int /*<<< orphan*/ strcpy(char *, char *const);
size_t strlen(char *const);
int /*<<< orphan*/ write_buf(char *, int, char *, char const *, int);
int main(int argc, char *const *argv) {
  int bytesread;
  char buffer[8192];
  int bufend = 0;
  int bufbegin = 0;
  int framesize, nextframesize;
  int nbytes = 0;
  int nframes = 0;
  int timetostop = 0;
  int layer, version, nextlayer, nextversion;
  char *Infile = 0, *Outfile = 0;
  const char *Outfile_prefix = 0;
  int Bytes_per_file = 1000000;
  int Tail_bytes = 8192 * 2;
  int Verbose = 0;
  int arg;
  for (arg = 1; arg < argc && argv[arg][0] == '-' && argv[arg][1] != '\0';
       arg++) {
    if (argv[arg][1] == 'v') {
      for (Verbose = 1; argv[arg][Verbose] == 'v'; Verbose++)
        ;
      if (argv[arg][Verbose] != '\0')
        fprintf(stderr, "Ignoring garbage after 'v' characters in arg '%s'\n",
                argv[arg]);
    } else if (!strcmp(argv[arg], "--clean"))
      ;
    else if (!strcmp(argv[arg], "--noclean"))
      ;
    else if (arg + 1 < argc && !strcmp(argv[arg], "--size")) {
      int param;
      if (sscanf(argv[arg + 1], "%d", &param))
        Bytes_per_file = param;
      else
        fprintf(stderr, "Couldn't read --size parameter '%s'; ignoring.\n",
                argv[arg + 1]);
      arg++;
    } else if (arg + 1 < argc && !strcmp(argv[arg], "--tail")) {
      int param;
      if (sscanf(argv[arg + 1], "%d", &param))
        Tail_bytes = param;
      else
        fprintf(stderr, "Couldn't read --tail parameter '%s'; ignoring.\n",
                argv[arg + 1]);
      arg++;
    } else
      fprintf(stderr, "Invalid argument '%s'; ignoring.\n", argv[arg]);
  }
  if (argc - arg != 2) {
    fprintf(
        stderr,
        "Usage: %s [options] { indir | - } { outdir | - }\n"
        "\n"
        "Options:\n"
        "  --size bytes  Set target size for mp3 files (mp3dir output only;\n"
        "                default 1000000).\n"
        "  --tail bytes  How far from the end of current.mp3 to start reading\n"
        "                (mp3dir input only; default 16384).\n"
        "  -v            Print more status information to stderr.\n"
        "\n"
        "Examples:\n"
        "  %s - - < dirty.mp3 > clean.mp3\n"
        "  {generate MP3 stream} | %s --size 99000 - /tmp/mp3dir\n"
        "  %s -v --tail 8000 /tmp/mp3dir - | {send to network client}\n"
        "\n"
        "WWW: http://tomclegg.net/mp3cat\n"
        "\n",
        argv[0], argv[0], argv[0], argv[0]);
    exit(1);
  }
  if (!strcmp(argv[arg], "-"))
    Infile = 0;
  else {
    if (!(Infile = malloc(strlen(argv[arg]) + 21))) {
      fprintf(stderr, "Couldn't allocate %zu bytes; giving up.",
              strlen(argv[arg]) + 21);
      exit(1);
    }
    strcpy(Infile, argv[arg]);
    if (Infile[strlen(Infile) - 1] != '/')
      strcat(Infile, "/");
    strcat(Infile, "current.mp3");
  }
  ++arg;
  if (!strcmp(argv[arg], "-"))
    Outfile = 0;
  else {
    Outfile_prefix = argv[arg];
    if (!(Outfile = malloc(strlen(argv[arg]) + 21))) {
      fprintf(stderr, "Couldn't allocate %zu bytes; giving up.",
              strlen(argv[arg]) + 21);
      exit(1);
    }
    strcpy(Outfile, argv[arg]);
    if (Outfile[strlen(Outfile)] != '/')
      strcat(Outfile, "/");
    strcat(Outfile, "current.mp3");
  }
  do {
    if (bufbegin > 8192 / 4) {
      bufend -= bufbegin;
      memmove(buffer, &buffer[bufbegin], bufend);
      bufbegin = 0;
    }
    if (bufend <= 8192 / 2 && !timetostop) {
      bytesread = read_buf(&buffer[bufend], 8192 - bufend, Infile, Tail_bytes);
      if (bytesread > 0)
        bufend += bytesread;
      else if (!Infile)
        timetostop = 1;
    }
    framesize =
        frame_length(&buffer[bufbegin], bufend - bufbegin, 0, &version, &layer);
    if (framesize > 0 &&
        (nextframesize = frame_length(&buffer[bufbegin + framesize],
                                      bufend - bufbegin - framesize, 0,
                                      &nextversion, &nextlayer)) &&
        nextversion == version && nextlayer == layer) {
      ++nframes;
      if (nbytes) {
        if (Verbose >= 1)
          fprintf(stderr, "%d junkbytes\n", nbytes);
        nbytes = 0;
      };
      if (0)
        frame_length(&buffer[bufbegin], bufend - bufbegin, 1, &version, &layer);
      write_buf(&buffer[bufbegin], framesize, Outfile, Outfile_prefix,
                Bytes_per_file);
      bufbegin += framesize;
    } else {
      ++nbytes;
      if (nframes) {
        if (Verbose >= 1)
          fprintf(stderr, "%d frames\n", nframes);
        nframes = 0;
      };
      if (Verbose >= 2 && framesize > 0) {
        fprintf(stderr, "Found: ");
        framesize = frame_length(&buffer[bufbegin], bufend - bufbegin, 1,
                                 &version, &layer);
        fprintf(stderr, "...but the next frame looks wrong");
        if (nextframesize)
          fprintf(stderr, " (version %d, layer %d)", nextversion, nextlayer);
        fprintf(stderr, "\n");
      }
      bufbegin++;
    }
  } while (bufbegin < bufend);
  if (nbytes) {
    if (Verbose >= 1)
      fprintf(stderr, "%d junkbytes\n", nbytes);
    nbytes = 0;
  };
  if (nframes) {
    if (Verbose >= 1)
      fprintf(stderr, "%d frames\n", nframes);
    nframes = 0;
  };
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x2024(%rbp)
movl   $0x0,-0x2028(%rbp)
movl   $0x0,-0x2034(%rbp)
movl   $0x0,-0x2038(%rbp)
movl   $0x0,-0x203c(%rbp)
movq   $0x0,-0x2058(%rbp)
movq   $0x0,-0x2060(%rbp)
movq   $0x0,-0x2068(%rbp)
movl   $0xf4240,-0x206c(%rbp)
movl   $0x4000,-0x2070(%rbp)
movl   $0x0,-0x2074(%rbp)
movl   $0x1,-0x2078(%rbp)
mov    -0x2078(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x2081(%rbp)
jge    12ad <main+0xed>
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x2081(%rbp)
jne    12ad <main+0xed>
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x2081(%rbp)
mov    -0x2081(%rbp),%al
test   $0x1,%al
jne    12c0 <main+0x100>
jmp    1583 <main+0x3c3>
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    $0x76,%eax
jne    1370 <main+0x1b0>
movl   $0x1,-0x2074(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2074(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x76,%eax
jne    1322 <main+0x162>
jmp    130e <main+0x14e>
mov    -0x2074(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2074(%rbp)
jmp    12e6 <main+0x126>
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2074(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     136b <main+0x1ab>
mov    0x2c94(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc9c(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    156a <main+0x3aa>
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcad(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1399 <main+0x1d9>
jmp    1565 <main+0x3a5>
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc8c(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    13c2 <main+0x202>
jmp    1560 <main+0x3a0>
mov    -0x2078(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    1479 <main+0x2b9>
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc5b(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1479 <main+0x2b9>
mov    -0x10(%rbp),%rax
mov    -0x2078(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc39(%rip),%rsi
lea    -0x207c(%rbp),%rdx
call   10a0 <sscanf@plt>
cmp    $0x0,%rax
je     143a <main+0x27a>
mov    -0x207c(%rbp),%eax
mov    %eax,-0x206c(%rbp)
jmp    1465 <main+0x2a5>
mov    0x2b9f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0x2078(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xbf1(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x2078(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2078(%rbp)
jmp    155b <main+0x39b>
mov    -0x2078(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    1530 <main+0x370>
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbde(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1530 <main+0x370>
mov    -0x10(%rbp),%rax
mov    -0x2078(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb82(%rip),%rsi
lea    -0x2080(%rbp),%rdx
call   10a0 <sscanf@plt>
cmp    $0x0,%rax
je     14f1 <main+0x331>
mov    -0x2080(%rbp),%eax
mov    %eax,-0x2070(%rbp)
jmp    151c <main+0x35c>
mov    0x2ae8(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0x2078(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xb71(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x2078(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2078(%rbp)
jmp    1556 <main+0x396>
mov    0x2aa9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xb67(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
jmp    155b <main+0x39b>
jmp    1560 <main+0x3a0>
jmp    1565 <main+0x3a5>
jmp    156a <main+0x3aa>
jmp    156f <main+0x3af>
mov    -0x2078(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2078(%rbp)
jmp    1254 <main+0x94>
mov    -0x8(%rbp),%eax
sub    -0x2078(%rbp),%eax
cmp    $0x2,%eax
je     15d2 <main+0x412>
mov    0x2a44(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    (%rax),%r8
mov    -0x10(%rbp),%rax
mov    (%rax),%r9
lea    0xb17(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd06(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1606 <main+0x446>
movq   $0x0,-0x2058(%rbp)
jmp    16f5 <main+0x535>
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x15,%rdi
call   1090 <malloc@plt>
mov    %rax,-0x2058(%rbp)
cmp    $0x0,%rax
jne    167f <main+0x4bf>
mov    0x29a2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2088(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
mov    -0x2088(%rbp),%edi
mov    %rax,%rdx
add    $0x15,%rdx
lea    0xc82(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x2058(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <strcpy@plt>
mov    -0x2058(%rbp),%rax
mov    %rax,-0x2090(%rbp)
mov    -0x2058(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x2090(%rbp),%rax
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     16e2 <main+0x522>
mov    -0x2058(%rbp),%rdi
lea    0xc3b(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x2058(%rbp),%rdi
lea    0xc2a(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x2078(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2078(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbd4(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1738 <main+0x578>
movq   $0x0,-0x2060(%rbp)
jmp    1839 <main+0x679>
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x2068(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x15,%rdi
call   1090 <malloc@plt>
mov    %rax,-0x2060(%rbp)
cmp    $0x0,%rax
jne    17c7 <main+0x607>
mov    0x285a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2094(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
mov    -0x2094(%rbp),%edi
mov    %rax,%rdx
add    $0x15,%rdx
lea    0xb3a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x2060(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x2078(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <strcpy@plt>
mov    -0x2060(%rbp),%rax
mov    %rax,-0x20a0(%rbp)
mov    -0x2060(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x20a0(%rbp),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     1826 <main+0x666>
mov    -0x2060(%rbp),%rdi
lea    0xaf7(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x2060(%rbp),%rdi
lea    0xae6(%rip),%rsi
call   10c0 <strcat@plt>
jmp    183e <main+0x67e>
cmpl   $0x800,-0x2028(%rbp)
jle    188f <main+0x6cf>
mov    -0x2028(%rbp),%ecx
mov    -0x2024(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x2024(%rbp)
lea    -0x2020(%rbp),%rdi
movslq -0x2028(%rbp),%rax
lea    -0x2020(%rbp),%rsi
add    %rax,%rsi
mov    -0x2024(%rbp),%edx
call   10b0 <memmove@plt>
movl   $0x0,-0x2028(%rbp)
cmpl   $0x1000,-0x2024(%rbp)
jg     191d <main+0x75d>
cmpl   $0x0,-0x203c(%rbp)
jne    191d <main+0x75d>
movslq -0x2024(%rbp),%rax
lea    -0x2020(%rbp),%rdi
add    %rax,%rdi
mov    $0x2000,%esi
sub    -0x2024(%rbp),%esi
mov    -0x2058(%rbp),%rdx
mov    -0x2070(%rbp),%ecx
call   1050 <read_buf@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    18fb <main+0x73b>
mov    -0x14(%rbp),%eax
add    -0x2024(%rbp),%eax
mov    %eax,-0x2024(%rbp)
jmp    1918 <main+0x758>
cmpq   $0x0,-0x2058(%rbp)
jne    1913 <main+0x753>
movl   $0x1,-0x203c(%rbp)
jmp    1918 <main+0x758>
jmp    191d <main+0x75d>
movslq -0x2028(%rbp),%rax
lea    -0x2020(%rbp),%rdi
add    %rax,%rdi
mov    -0x2024(%rbp),%esi
sub    -0x2028(%rbp),%esi
xor    %edx,%edx
lea    -0x2044(%rbp),%rcx
lea    -0x2040(%rbp),%r8
call   1060 <frame_length@plt>
mov    %eax,-0x202c(%rbp)
cmpl   $0x0,-0x202c(%rbp)
jle    1a6c <main+0x8ac>
mov    -0x2028(%rbp),%eax
add    -0x202c(%rbp),%eax
cltq
lea    -0x2020(%rbp),%rdi
add    %rax,%rdi
mov    -0x2024(%rbp),%esi
sub    -0x2028(%rbp),%esi
sub    -0x202c(%rbp),%esi
xor    %edx,%edx
lea    -0x204c(%rbp),%rcx
lea    -0x2048(%rbp),%r8
call   1060 <frame_length@plt>
mov    %eax,-0x2030(%rbp)
cmp    $0x0,%eax
je     1a6c <main+0x8ac>
mov    -0x204c(%rbp),%eax
cmp    -0x2044(%rbp),%eax
jne    1a6c <main+0x8ac>
mov    -0x2048(%rbp),%eax
cmp    -0x2040(%rbp),%eax
jne    1a6c <main+0x8ac>
mov    -0x2038(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2038(%rbp)
cmpl   $0x0,-0x2034(%rbp)
je     1a24 <main+0x864>
cmpl   $0x1,-0x2074(%rbp)
jl     1a1a <main+0x85a>
mov    0x25dc(%rip),%rax
mov    (%rax),%edi
mov    -0x2034(%rbp),%edx
lea    0x913(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x2034(%rbp)
movslq -0x2028(%rbp),%rax
lea    -0x2020(%rbp),%rdi
add    %rax,%rdi
mov    -0x202c(%rbp),%esi
mov    -0x2060(%rbp),%rdx
mov    -0x2068(%rbp),%rcx
mov    -0x206c(%rbp),%r8d
call   10e0 <write_buf@plt>
mov    -0x202c(%rbp),%eax
add    -0x2028(%rbp),%eax
mov    %eax,-0x2028(%rbp)
jmp    1b95 <main+0x9d5>
mov    -0x2034(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2034(%rbp)
cmpl   $0x0,-0x2038(%rbp)
je     1abc <main+0x8fc>
cmpl   $0x1,-0x2074(%rbp)
jl     1ab2 <main+0x8f2>
mov    0x2544(%rip),%rax
mov    (%rax),%edi
mov    -0x2038(%rbp),%edx
lea    0x889(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x2038(%rbp)
cmpl   $0x2,-0x2074(%rbp)
jl     1b86 <main+0x9c6>
cmpl   $0x0,-0x202c(%rbp)
jle    1b86 <main+0x9c6>
mov    0x2503(%rip),%rax
mov    (%rax),%edi
lea    0x859(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movslq -0x2028(%rbp),%rax
lea    -0x2020(%rbp),%rdi
add    %rax,%rdi
mov    -0x2024(%rbp),%esi
sub    -0x2028(%rbp),%esi
mov    $0x1,%edx
lea    -0x2044(%rbp),%rcx
lea    -0x2040(%rbp),%r8
call   1060 <frame_length@plt>
mov    %eax,-0x202c(%rbp)
mov    0x24b1(%rip),%rax
mov    (%rax),%edi
lea    0x80f(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
cmpl   $0x0,-0x2030(%rbp)
je     1b6f <main+0x9af>
mov    0x248d(%rip),%rax
mov    (%rax),%edi
mov    -0x204c(%rbp),%edx
mov    -0x2048(%rbp),%ecx
lea    0x801(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x246a(%rip),%rax
mov    (%rax),%edi
lea    0x76d(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x2028(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2028(%rbp)
jmp    1b9a <main+0x9da>
mov    -0x2028(%rbp),%eax
cmp    -0x2024(%rbp),%eax
jl     183e <main+0x67e>
cmpl   $0x0,-0x2034(%rbp)
je     1bed <main+0xa2d>
cmpl   $0x1,-0x2074(%rbp)
jl     1be3 <main+0xa23>
mov    0x2413(%rip),%rax
mov    (%rax),%edi
mov    -0x2034(%rbp),%edx
lea    0x74a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x2034(%rbp)
cmpl   $0x0,-0x2038(%rbp)
je     1c2e <main+0xa6e>
cmpl   $0x1,-0x2074(%rbp)
jl     1c24 <main+0xa64>
mov    0x23d2(%rip),%rax
mov    (%rax),%edi
mov    -0x2038(%rbp),%edx
lea    0x717(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x2038(%rbp)
xor    %edi,%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2058,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x2,%edi
mov    %rsi,0x8(%rsp)
jl     13b7 <main+0x1f7>
movl   $0xf4240,0x10(%rsp)
movl   $0x4000,0x14(%rsp)
mov    $0x1,%r14d
lea    0xe32(%rip),%r15
xor    %r12d,%r12d
jmp    123d <main+0x7d>
mov    0x2dd3(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbx,%r15
mov    0x8(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
add    $0x1,%r14d
cmp    %ebp,%r14d
jge    13d0 <main+0x210>
movslq %r14d,%rax
mov    (%rbx,%rax,8),%r13
cmpb   $0x2d,0x0(%r13)
jne    13d0 <main+0x210>
mov    0x1(%r13),%al
cmp    $0x76,%al
je     1300 <main+0x140>
test   %al,%al
je     13d0 <main+0x210>
mov    %r13,%rdi
mov    %r15,%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1230 <main+0x70>
mov    %r13,%rdi
lea    0xdbf(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1230 <main+0x70>
mov    %r15,%rbx
mov    %ebp,%eax
lea    0x1(%r14),%r15d
cmp    %ebp,%r15d
jge    1206 <main+0x46>
mov    %r13,%rdi
lea    0xda4(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1349 <main+0x189>
mov    %r13,%rdi
lea    0xdc7(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
jne    1206 <main+0x46>
movslq %r15d,%r14
mov    0x8(%rsp),%r13
mov    0x0(%r13,%r14,8),%rdi
lea    0xd73(%rip),%rsi
lea    0x50(%rsp),%rdx
call   10a0 <sscanf@plt>
test   %rax,%rax
je     138d <main+0x1cd>
mov    0x50(%rsp),%eax
mov    %eax,0x14(%rsp)
jmp    13a9 <main+0x1e9>
nopl   0x0(%rax)
mov    $0x2,%r12d
cmp    $0x76,%al
jne    131e <main+0x15e>
nopw   0x0(%rax,%rax,1)
movzbl 0x0(%r13,%r12,1),%eax
add    $0x1,%r12
cmp    $0x76,%al
je     1310 <main+0x150>
add    $0xffffffff,%r12d
test   %al,%al
je     1230 <main+0x70>
mov    0x2caf(%rip),%rax
mov    (%rax),%edi
lea    0xcc6(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1230 <main+0x70>
movslq %r15d,%r14
mov    0x8(%rsp),%r13
mov    0x0(%r13,%r14,8),%rdi
lea    0xcef(%rip),%rsi
lea    0x50(%rsp),%rdx
call   10a0 <sscanf@plt>
test   %rax,%rax
je     1376 <main+0x1b6>
mov    0x50(%rsp),%eax
mov    %eax,0x10(%rsp)
jmp    13a9 <main+0x1e9>
mov    0x2c63(%rip),%rax
mov    (%rax),%edi
mov    0x0(%r13,%r14,8),%rdx
lea    0xcc4(%rip),%rsi
jmp    13a2 <main+0x1e2>
mov    0x2c4c(%rip),%rax
mov    (%rax),%edi
mov    0x0(%r13,%r14,8),%rdx
lea    0xce4(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r15d,%r14d
mov    %rbx,%r15
mov    %r13,%rbx
jmp    1230 <main+0x70>
mov    $0x1,%r14d
xor    %r12d,%r12d
movl   $0x4000,0x14(%rsp)
movl   $0xf4240,0x10(%rsp)
sub    %r14d,%ebp
cmp    $0x2,%ebp
jne    13fa <main+0x23a>
movslq %r14d,%r15
mov    (%rbx,%r15,8),%rbp
lea    0xf08(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
jne    1427 <main+0x267>
xor    %r13d,%r13d
jmp    1497 <main+0x2d7>
mov    0x2bdf(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rcx
lea    0xccb(%rip),%rsi
mov    %rcx,%rdx
mov    %rcx,%r8
mov    %rcx,%r9
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %rax,%r14
add    $0x15,%r14
mov    %r14,%rdi
call   1090 <malloc@plt>
test   %rax,%rax
jne    145b <main+0x29b>
mov    0x2b96(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
mov    %r14,%rdx
jmp    14fb <main+0x33b>
mov    %rax,%r13
mov    %rax,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
mov    %r13,%rdi
call   1040 <strlen@plt>
cmpb   $0x2f,-0x1(%rax,%r13,1)
je     1488 <main+0x2c8>
lea    0xe98(%rip),%rsi
mov    %r13,%rdi
call   10c0 <strcat@plt>
lea    0xe8b(%rip),%rsi
mov    %r13,%rdi
call   10c0 <strcat@plt>
mov    0x8(%rsp),%rax
mov    0x8(%rax,%r15,8),%rbp
lea    0xe46(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
jne    14cc <main+0x30c>
mov    %r13,0x40(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %eax,%eax
mov    %rax,0x38(%rsp)
jmp    155d <main+0x39d>
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
add    $0x15,%rbx
mov    %rbx,%rdi
call   1090 <malloc@plt>
test   %rax,%rax
jne    150c <main+0x34c>
mov    0x2af1(%rip),%rax
mov    (%rax),%edi
lea    0xdf8(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    %r13,0x40(%rsp)
mov    %rax,%rdi
mov    %rax,0x18(%rsp)
mov    %rbp,0x38(%rsp)
mov    %rbp,%rsi
call   1030 <strcpy@plt>
mov    0x18(%rsp),%rdi
call   1040 <strlen@plt>
mov    0x18(%rsp),%rcx
cmpb   $0x2f,(%rcx,%rax,1)
mov    0x18(%rsp),%rdi
je     1551 <main+0x391>
lea    0xdd1(%rip),%rsi
call   10c0 <strcat@plt>
mov    0x18(%rsp),%rdi
lea    0xdc2(%rip),%rsi
call   10c0 <strcat@plt>
xor    %ebp,%ebp
xor    %r13d,%r13d
xor    %edx,%edx
movl   $0x0,(%rsp)
xor    %ebx,%ebx
jmp    15a3 <main+0x3e3>
nop
mov    (%r14),%edi
lea    0xd72(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x8(%rsp),%edx
add    $0x1,%edx
add    $0x1,%r13d
movl   $0x0,(%rsp)
mov    %r13d,%r14d
mov    0x4(%rsp),%ebx
cmp    %ebp,%r14d
jge    1793 <main+0x5d3>
cmp    $0x801,%r13d
mov    %edx,0x8(%rsp)
jl     15cd <main+0x40d>
sub    %r13d,%ebp
mov    %r13d,%eax
lea    (%rsp,%rax,1),%rsi
add    $0x50,%rsi
lea    0x50(%rsp),%rdi
mov    %ebp,%edx
call   10b0 <memmove@plt>
xor    %r13d,%r13d
cmp    $0x1000,%ebp
jg     1620 <main+0x460>
test   %ebx,%ebx
jne    1620 <main+0x460>
mov    0x40(%rsp),%rdx
test   %rdx,%rdx
sete   %bl
movslq %ebp,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x50,%rdi
mov    $0x2000,%esi
sub    %ebp,%esi
mov    0x14(%rsp),%ecx
call   1050 <read_buf@plt>
test   %eax,%eax
setle  %cl
jns    1608 <main+0x448>
xor    %eax,%eax
add    %eax,%ebp
and    %cl,%bl
movzbl %bl,%eax
mov    %eax,0x4(%rsp)
jmp    1624 <main+0x464>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,0x4(%rsp)
movslq %r13d,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x50,%rdi
mov    %ebp,%ebx
sub    %eax,%ebx
mov    %rdi,0x48(%rsp)
mov    %ebx,%esi
xor    %edx,%edx
lea    0x30(%rsp),%rcx
lea    0x34(%rsp),%r8
call   1060 <frame_length@plt>
mov    %eax,%r15d
test   %eax,%eax
jle    16f0 <main+0x530>
lea    (%r15,%r13,1),%r14d
movslq %r14d,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x50,%rdi
mov    %ebx,%esi
sub    %r15d,%esi
movl   $0x0,0x24(%rsp)
xor    %edx,%edx
lea    0x28(%rsp),%rcx
lea    0x2c(%rsp),%r8
call   1060 <frame_length@plt>
test   %eax,%eax
je     16f0 <main+0x530>
mov    %eax,0x24(%rsp)
mov    0x28(%rsp),%eax
cmp    0x30(%rsp),%eax
jne    16f0 <main+0x530>
mov    0x2c(%rsp),%eax
cmp    0x34(%rsp),%eax
jne    16f0 <main+0x530>
mov    0x8(%rsp),%edx
test   %edx,%edx
je     16c3 <main+0x503>
test   %r12d,%r12d
jle    16c3 <main+0x503>
mov    0x292d(%rip),%rax
mov    (%rax),%edi
lea    0xc6a(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
addl   $0x1,(%rsp)
mov    0x48(%rsp),%rdi
mov    %r15d,%esi
mov    0x18(%rsp),%rdx
mov    0x38(%rsp),%rcx
mov    0x10(%rsp),%r8d
call   10e0 <write_buf@plt>
xor    %edx,%edx
mov    %r14d,%r13d
jmp    1596 <main+0x3d6>
nopl   (%rax)
mov    (%rsp),%edx
test   %edx,%edx
je     1713 <main+0x553>
test   %r12d,%r12d
jle    1713 <main+0x553>
mov    0x28dd(%rip),%rax
mov    (%rax),%edi
lea    0xc28(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
cmp    $0x2,%r12d
jl     1581 <main+0x3c1>
test   %r15d,%r15d
jle    1581 <main+0x3c1>
mov    0x28b3(%rip),%r14
mov    (%r14),%edi
lea    0xc08(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x48(%rsp),%rdi
mov    %ebx,%esi
mov    $0x1,%edx
lea    0x30(%rsp),%rcx
lea    0x34(%rsp),%r8
call   1060 <frame_length@plt>
mov    (%r14),%edi
lea    0xbe4(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
cmpl   $0x0,0x24(%rsp)
je     1570 <main+0x3b0>
mov    (%r14),%edi
mov    0x28(%rsp),%edx
mov    0x2c(%rsp),%ecx
lea    0xbe2(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    1570 <main+0x3b0>
test   %edx,%edx
mov    0x2844(%rip),%rbx
je     17b3 <main+0x5f3>
test   %r12d,%r12d
jle    17b3 <main+0x5f3>
mov    (%rbx),%edi
lea    0xb7a(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%rsp),%edx
test   %edx,%edx
je     17cf <main+0x60f>
test   %r12d,%r12d
jle    17cf <main+0x60f>
mov    (%rbx),%edi
lea    0xb6c(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"Ignoring garbage after 'v' characters in arg '%s'\0A\00"
@.str.1 = [8 x i8] c"--clean\00"
@.str.2 = [10 x i8] c"--noclean\00"
@.str.3 = [7 x i8] c"--size\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [48 x i8] c"Couldn't read --size parameter '%s'; ignoring.\0A\00"
@.str.6 = [7 x i8] c"--tail\00"
@.str.7 = [48 x i8] c"Couldn't read --tail parameter '%s'; ignoring.\0A\00"
@.str.8 = [34 x i8] c"Invalid argument '%s'; ignoring.\0A\00"
@.str.9 = [534 x i8] c"Usage: %s [options] { indir | - } { outdir | - }\0A\0AOptions:\0A --size bytes Set target size for mp3 files (mp3dir output only;\0A default 1000000).\0A --tail bytes How far from the end of current.mp3 to start reading\0A (mp3dir input only; default 16384).\0A -v Print more status information to stderr.\0A\0AExamples:\0A %s - - < dirty.mp3 > clean.mp3\0A {generate MP3 stream} | %s --size 99000 - /tmp/mp3dir\0A %s -v --tail 8000 /tmp/mp3dir - | {send to network client}\0A\0AWWW: http://tomclegg.net/mp3cat\0A\0A\00"
@.str.10 = [2 x i8] c"-\00"
@.str.11 = [40 x i8] c"Couldn't allocate %zu bytes; giving up.\00"
@.str.12 = [2 x i8] c"/\00"
@.str.13 = [12 x i8] c"current.mp3\00"
@.str.14 = [14 x i8] c"%d junkbytes\0A\00"
@.str.15 = [11 x i8] c"%d frames\0A\00"
@.str.16 = [8 x i8] c"Found: \00"
@.str.17 = [34 x i8] c"...but the next frame looks wrong\00"
@.str.18 = [24 x i8] c" (version %d, layer %d)\00"
@.str.19 = [2 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 [8192 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
store i8* null, i8** %19
store i8* null, i8** %20
store i8* null, i8** %21
store i32 1000000, i32* %22
store i32 16384, i32* %23
store i32 0, i32* %24
store i32 1, i32* %25
br label %28
28: ; preds = %205, %2
%29 = load i32, i32* %25
%30 = load i32, i32* %4
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %52
32: ; preds = %28
%33 = load i8**, i8*** %5
%34 = load i32, i32* %25
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = getelementptr inbounds i8, i8* %37, i64 0
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 45
br i1 %41, label %42, label %52
42: ; preds = %32
%43 = load i8**, i8*** %5
%44 = load i32, i32* %25
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8*, i8** %43, i64 %45
%47 = load i8*, i8** %46
%48 = getelementptr inbounds i8, i8* %47, i64 1
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp ne i32 %50, 0
br label %52
52: ; preds = %42, %32, %28
%53 = phi i1 [ false, %32 ], [ false, %28 ], [ %51, %42 ]
br i1 %53, label %54, label %208
54: ; preds = %52
%55 = load i8**, i8*** %5
%56 = load i32, i32* %25
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8*, i8** %55, i64 %57
%59 = load i8*, i8** %58
%60 = getelementptr inbounds i8, i8* %59, i64 1
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %62, 118
br i1 %63, label %64, label %102
64: ; preds = %54
store i32 1, i32* %24
br label %65
65: ; preds = %78, %64
%66 = load i8**, i8*** %5
%67 = load i32, i32* %25
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8*, i8** %66, i64 %68
%70 = load i8*, i8** %69
%71 = load i32, i32* %24
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8, i8* %70, i64 %72
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 118
br i1 %76, label %77, label %81
77: ; preds = %65
br label %78
78: ; preds = %77
%79 = load i32, i32* %24
%80 = add nsw i32 %79, 1
store i32 %80, i32* %24
br label %65
81: ; preds = %65
%82 = load i8**, i8*** %5
%83 = load i32, i32* %25
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8*, i8** %82, i64 %84
%86 = load i8*, i8** %85
%87 = load i32, i32* %24
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %86, i64 %88
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %101
93: ; preds = %81
%94 = load i32, i32* @stderr
%95 = load i8**, i8*** %5
%96 = load i32, i32* %25
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i8*, i8** %95, i64 %97
%99 = load i8*, i8** %98
%100 = call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %99)
br label %101
101: ; preds = %93, %81
br label %204
102: ; preds = %54
%103 = load i8**, i8*** %5
%104 = load i32, i32* %25
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8*, i8** %103, i64 %105
%107 = load i8*, i8** %106
%108 = call i32 @strcmp(i8* %107, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%109 = icmp ne i32 %108, 0
br i1 %109, label %111, label %110
110: ; preds = %102
br label %203
111: ; preds = %102
%112 = load i8**, i8*** %5
%113 = load i32, i32* %25
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds i8*, i8** %112, i64 %114
%116 = load i8*, i8** %115
%117 = call i32 @strcmp(i8* %116, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%118 = icmp ne i32 %117, 0
br i1 %118, label %120, label %119
119: ; preds = %111
br label %202
120: ; preds = %111
%121 = load i32, i32* %25
%122 = add nsw i32 %121, 1
%123 = load i32, i32* %4
%124 = icmp slt i32 %122, %123
br i1 %124, label %125, label %156
125: ; preds = %120
%126 = load i8**, i8*** %5
%127 = load i32, i32* %25
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds i8*, i8** %126, i64 %128
%130 = load i8*, i8** %129
%131 = call i32 @strcmp(i8* %130, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%132 = icmp ne i32 %131, 0
br i1 %132, label %156, label %133
133: ; preds = %125
%134 = load i8**, i8*** %5
%135 = load i32, i32* %25
%136 = add nsw i32 %135, 1
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i8*, i8** %134, i64 %137
%139 = load i8*, i8** %138
%140 = call i64 @sscanf(i8* %139, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %26)
%141 = icmp ne i64 %140, 0
br i1 %141, label %142, label %144
142: ; preds = %133
%143 = load i32, i32* %26
store i32 %143, i32* %22
br label %153
144: ; preds = %133
%145 = load i32, i32* @stderr
%146 = load i8**, i8*** %5
%147 = load i32, i32* %25
%148 = add nsw i32 %147, 1
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i8*, i8** %146, i64 %149
%151 = load i8*, i8** %150
%152 = call i32 (i32, i8*, ...) @fprintf(i32 %145, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0), i8* %151)
br label %153
153: ; preds = %144, %142
%154 = load i32, i32* %25
%155 = add nsw i32 %154, 1
store i32 %155, i32* %25
br label %201
156: ; preds = %125, %120
%157 = load i32, i32* %25
%158 = add nsw i32 %157, 1
%159 = load i32, i32* %4
%160 = icmp slt i32 %158, %159
br i1 %160, label %161, label %192
161: ; preds = %156
%162 = load i8**, i8*** %5
%163 = load i32, i32* %25
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds i8*, i8** %162, i64 %164
%166 = load i8*, i8** %165
%167 = call i32 @strcmp(i8* %166, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%168 = icmp ne i32 %167, 0
br i1 %168, label %192, label %169
169: ; preds = %161
%170 = load i8**, i8*** %5
%171 = load i32, i32* %25
%172 = add nsw i32 %171, 1
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i8*, i8** %170, i64 %173
%175 = load i8*, i8** %174
%176 = call i64 @sscanf(i8* %175, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %27)
%177 = icmp ne i64 %176, 0
br i1 %177, label %178, label %180
178: ; preds = %169
%179 = load i32, i32* %27
store i32 %179, i32* %23
br label %189
180: ; preds = %169
%181 = load i32, i32* @stderr
%182 = load i8**, i8*** %5
%183 = load i32, i32* %25
%184 = add nsw i32 %183, 1
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds i8*, i8** %182, i64 %185
%187 = load i8*, i8** %186
%188 = call i32 (i32, i8*, ...) @fprintf(i32 %181, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* %187)
br label %189
189: ; preds = %180, %178
%190 = load i32, i32* %25
%191 = add nsw i32 %190, 1
store i32 %191, i32* %25
br label %200
192: ; preds = %161, %156
%193 = load i32, i32* @stderr
%194 = load i8**, i8*** %5
%195 = load i32, i32* %25
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds i8*, i8** %194, i64 %196
%198 = load i8*, i8** %197
%199 = call i32 (i32, i8*, ...) @fprintf(i32 %193, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i8* %198)
br label %200
200: ; preds = %192, %189
br label %201
201: ; preds = %200, %153
br label %202
202: ; preds = %201, %119
br label %203
203: ; preds = %202, %110
br label %204
204: ; preds = %203, %101
br label %205
205: ; preds = %204
%206 = load i32, i32* %25
%207 = add nsw i32 %206, 1
store i32 %207, i32* %25
br label %28
208: ; preds = %52
%209 = load i32, i32* %4
%210 = load i32, i32* %25
%211 = sub nsw i32 %209, %210
%212 = icmp ne i32 %211, 2
br i1 %212, label %213, label %229
213: ; preds = %208
%214 = load i32, i32* @stderr
%215 = load i8**, i8*** %5
%216 = getelementptr inbounds i8*, i8** %215, i64 0
%217 = load i8*, i8** %216
%218 = load i8**, i8*** %5
%219 = getelementptr inbounds i8*, i8** %218, i64 0
%220 = load i8*, i8** %219
%221 = load i8**, i8*** %5
%222 = getelementptr inbounds i8*, i8** %221, i64 0
%223 = load i8*, i8** %222
%224 = load i8**, i8*** %5
%225 = getelementptr inbounds i8*, i8** %224, i64 0
%226 = load i8*, i8** %225
%227 = call i32 (i32, i8*, ...) @fprintf(i32 %214, i8* getelementptr inbounds ([534 x i8], [534 x i8]* @.str.9, i64 0, i64 0), i8* %217, i8* %220, i8* %223, i8* %226)
%228 = call i32 @exit(i32 1)
unreachable
229: ; preds = %208
%230 = load i8**, i8*** %5
%231 = load i32, i32* %25
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds i8*, i8** %230, i64 %232
%234 = load i8*, i8** %233
%235 = call i32 @strcmp(i8* %234, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%236 = icmp ne i32 %235, 0
br i1 %236, label %238, label %237
237: ; preds = %229
store i8* null, i8** %19
br label %281
238: ; preds = %229
%239 = load i8**, i8*** %5
%240 = load i32, i32* %25
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds i8*, i8** %239, i64 %241
%243 = load i8*, i8** %242
%244 = call i64 @strlen(i8* %243)
%245 = add i64 %244, 21
%246 = call i8* @malloc(i64 %245)
store i8* %246, i8** %19
%247 = icmp ne i8* %246, null
br i1 %247, label %259, label %248
248: ; preds = %238
%249 = load i32, i32* @stderr
%250 = load i8**, i8*** %5
%251 = load i32, i32* %25
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds i8*, i8** %250, i64 %252
%254 = load i8*, i8** %253
%255 = call i64 @strlen(i8* %254)
%256 = add i64 %255, 21
%257 = call i32 (i32, i8*, ...) @fprintf(i32 %249, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0), i64 %256)
%258 = call i32 @exit(i32 1)
unreachable
259: ; preds = %238
%260 = load i8*, i8** %19
%261 = load i8**, i8*** %5
%262 = load i32, i32* %25
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds i8*, i8** %261, i64 %263
%265 = load i8*, i8** %264
%266 = call i32 @strcpy(i8* %260, i8* %265)
%267 = load i8*, i8** %19
%268 = load i8*, i8** %19
%269 = call i64 @strlen(i8* %268)
%270 = sub i64 %269, 1
%271 = getelementptr inbounds i8, i8* %267, i64 %270
%272 = load i8, i8* %271
%273 = sext i8 %272 to i32
%274 = icmp ne i32 %273, 47
br i1 %274, label %275, label %278
275: ; preds = %259
%276 = load i8*, i8** %19
%277 = call i32 @strcat(i8* %276, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %278
278: ; preds = %275, %259
%279 = load i8*, i8** %19
%280 = call i32 @strcat(i8* %279, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
br label %281
281: ; preds = %278, %237
%282 = load i32, i32* %25
%283 = add nsw i32 %282, 1
store i32 %283, i32* %25
%284 = load i8**, i8*** %5
%285 = load i32, i32* %25
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds i8*, i8** %284, i64 %286
%288 = load i8*, i8** %287
%289 = call i32 @strcmp(i8* %288, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%290 = icmp ne i32 %289, 0
br i1 %290, label %292, label %291
291: ; preds = %281
store i8* null, i8** %20
br label %339
292: ; preds = %281
%293 = load i8**, i8*** %5
%294 = load i32, i32* %25
%295 = sext i32 %294 to i64
%296 = getelementptr inbounds i8*, i8** %293, i64 %295
%297 = load i8*, i8** %296
store i8* %297, i8** %21
%298 = load i8**, i8*** %5
%299 = load i32, i32* %25
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds i8*, i8** %298, i64 %300
%302 = load i8*, i8** %301
%303 = call i64 @strlen(i8* %302)
%304 = add i64 %303, 21
%305 = call i8* @malloc(i64 %304)
store i8* %305, i8** %20
%306 = icmp ne i8* %305, null
br i1 %306, label %318, label %307
307: ; preds = %292
%308 = load i32, i32* @stderr
%309 = load i8**, i8*** %5
%310 = load i32, i32* %25
%311 = sext i32 %310 to i64
%312 = getelementptr inbounds i8*, i8** %309, i64 %311
%313 = load i8*, i8** %312
%314 = call i64 @strlen(i8* %313)
%315 = add i64 %314, 21
%316 = call i32 (i32, i8*, ...) @fprintf(i32 %308, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0), i64 %315)
%317 = call i32 @exit(i32 1)
unreachable
318: ; preds = %292
%319 = load i8*, i8** %20
%320 = load i8**, i8*** %5
%321 = load i32, i32* %25
%322 = sext i32 %321 to i64
%323 = getelementptr inbounds i8*, i8** %320, i64 %322
%324 = load i8*, i8** %323
%325 = call i32 @strcpy(i8* %319, i8* %324)
%326 = load i8*, i8** %20
%327 = load i8*, i8** %20
%328 = call i64 @strlen(i8* %327)
%329 = getelementptr inbounds i8, i8* %326, i64 %328
%330 = load i8, i8* %329
%331 = sext i8 %330 to i32
%332 = icmp ne i32 %331, 47
br i1 %332, label %333, label %336
333: ; preds = %318
%334 = load i8*, i8** %20
%335 = call i32 @strcat(i8* %334, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %336
336: ; preds = %333, %318
%337 = load i8*, i8** %20
%338 = call i32 @strcat(i8* %337, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
br label %339
339: ; preds = %336, %291
br label %340
340: ; preds = %481, %339
%341 = load i32, i32* %9
%342 = icmp sgt i32 %341, 2048
br i1 %342, label %343, label %353
343: ; preds = %340
%344 = load i32, i32* %9
%345 = load i32, i32* %8
%346 = sub nsw i32 %345, %344
store i32 %346, i32* %8
%347 = getelementptr inbounds [8192 x i8], [8192 x i8]* %7, i64 0, i64 0
%348 = load i32, i32* %9
%349 = sext i32 %348 to i64
%350 = getelementptr inbounds [8192 x i8], [8192 x i8]* %7, i64 0, i64 %349
%351 = load i32, i32* %8
%352 = call i32 @memmove(i8* %347, i8* %350, i32 %351)
store i32 0, i32* %9
br label %353
353: ; preds = %343, %340
%354 = load i32, i32* %8
%355 = icmp sle i32 %354, 4096
br i1 %355, label %356, label %380
356: ; preds = %353
%357 = load i32, i32* %14
%358 = icmp ne i32 %357, 0
br i1 %358, label %380, label %359
359: ; preds = %356
%360 = load i32, i32* %8
%361 = sext i32 %360 to i64
%362 = getelementptr inbounds [8192 x i8], [8192 x i8]* %7, i64 0, i64 %361
%363 = load i32, i32* %8
%364 = sub nsw i32 8192, %363
%365 = load i8*, i8** %19
%366 = load i32, i32* %23
%367 = call i32 @read_buf(i8* %362, i32 %364, i8* %365, i32 %366)
store i32 %367, i32* %6
%368 = load i32, i32* %6
%369 = icmp sgt i32 %368, 0
br i1 %369, label %370, label %374
370: ; preds = %359
%371 = load i32, i32* %6
%372 = load i32, i32* %8
%373 = add nsw i32 %372, %371
store i32 %373, i32* %8
br label %379
374: ; preds = %359
%375 = load i8*, i8** %19
%376 = icmp ne i8* %375, null
br i1 %376, label %378, label %377
377: ; preds = %374
store i32 1, i32* %14
br label %378
378: ; preds = %377, %374
br label %379
379: ; preds = %378, %370
br label %380
380: ; preds = %379, %356, %353
%381 = load i32, i32* %9
%382 = sext i32 %381 to i64
%383 = getelementptr inbounds [8192 x i8], [8192 x i8]* %7, i64 0, i64 %382
%384 = load i32, i32* %8
%385 = load i32, i32* %9
%386 = sub nsw i32 %384, %385
%387 = call i32 @frame_length(i8* %383, i32 %386, i32 0, i32* %16, i32* %15)
store i32 %387, i32* %10
%388 = load i32, i32* %10
%389 = icmp sgt i32 %388, 0
br i1 %389, label %390, label %436
390: ; preds = %380
%391 = load i32, i32* %9
%392 = load i32, i32* %10
%393 = add nsw i32 %391, %392
%394 = sext i32 %393 to i64
%395 = getelementptr inbounds [8192 x i8], [8192 x i8]* %7, i64 0, i64 %394
%396 = load i32, i32* %8
%397 = load i32, i32* %9
%398 = sub nsw i32 %396, %397
%399 = load i32, i32* %10
%400 = sub nsw i32 %398, %399
%401 = call i32 @frame_length(i8* %395, i32 %400, i32 0, i32* %18, i32* %17)
store i32 %401, i32* %11
%402 = icmp ne i32 %401, 0
br i1 %402, label %403, label %436
403: ; preds = %390
%404 = load i32, i32* %18
%405 = load i32, i32* %16
%406 = icmp eq i32 %404, %405
br i1 %406, label %407, label %436
407: ; preds = %403
%408 = load i32, i32* %17
%409 = load i32, i32* %15
%410 = icmp eq i32 %408, %409
br i1 %410, label %411, label %436
411: ; preds = %407
%412 = load i32, i32* %13
%413 = add nsw i32 %412, 1
store i32 %413, i32* %13
%414 = load i32, i32* %12
%415 = icmp ne i32 %414, 0
br i1 %415, label %416, label %424
416: ; preds = %411
%417 = load i32, i32* %24
%418 = icmp sge i32 %417, 1
br i1 %418, label %419, label %423
419: ; preds = %416
%420 = load i32, i32* @stderr
%421 = load i32, i32* %12
%422 = call i32 (i32, i8*, ...) @fprintf(i32 %420, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0), i32 %421)
br label %423
423: ; preds = %419, %416
store i32 0, i32* %12
br label %424
424: ; preds = %423, %411
%425 = load i32, i32* %9
%426 = sext i32 %425 to i64
%427 = getelementptr inbounds [8192 x i8], [8192 x i8]* %7, i64 0, i64 %426
%428 = load i32, i32* %10
%429 = load i8*, i8** %20
%430 = load i8*, i8** %21
%431 = load i32, i32* %22
%432 = call i32 @write_buf(i8* %427, i32 %428, i8* %429, i8* %430, i32 %431)
%433 = load i32, i32* %10
%434 = load i32, i32* %9
%435 = add nsw i32 %434, %433
store i32 %435, i32* %9
br label %480
436: ; preds = %407, %403, %390, %380
%437 = load i32, i32* %12
%438 = add nsw i32 %437, 1
store i32 %438, i32* %12
%439 = load i32, i32* %13
%440 = icmp ne i32 %439, 0
br i1 %440, label %441, label %449
441: ; preds = %436
%442 = load i32, i32* %24
%443 = icmp sge i32 %442, 1
br i1 %443, label %444, label %448
444: ; preds = %441
%445 = load i32, i32* @stderr
%446 = load i32, i32* %13
%447 = call i32 (i32, i8*, ...) @fprintf(i32 %445, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i32 %446)
br label %448
448: ; preds = %444, %441
store i32 0, i32* %13
br label %449
449: ; preds = %448, %436
%450 = load i32, i32* %24
%451 = icmp sge i32 %450, 2
br i1 %451, label %452, label %477
452: ; preds = %449
%453 = load i32, i32* %10
%454 = icmp sgt i32 %453, 0
br i1 %454, label %455, label %477
455: ; preds = %452
%456 = load i32, i32* @stderr
%457 = call i32 (i32, i8*, ...) @fprintf(i32 %456, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
%458 = load i32, i32* %9
%459 = sext i32 %458 to i64
%460 = getelementptr inbounds [8192 x i8], [8192 x i8]* %7, i64 0, i64 %459
%461 = load i32, i32* %8
%462 = load i32, i32* %9
%463 = sub nsw i32 %461, %462
%464 = call i32 @frame_length(i8* %460, i32 %463, i32 1, i32* %16, i32* %15)
store i32 %464, i32* %10
%465 = load i32, i32* @stderr
%466 = call i32 (i32, i8*, ...) @fprintf(i32 %465, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.17, i64 0, i64 0))
%467 = load i32, i32* %11
%468 = icmp ne i32 %467, 0
br i1 %468, label %469, label %474
469: ; preds = %455
%470 = load i32, i32* @stderr
%471 = load i32, i32* %18
%472 = load i32, i32* %17
%473 = call i32 (i32, i8*, ...) @fprintf(i32 %470, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i64 0, i64 0), i32 %471, i32 %472)
br label %474
474: ; preds = %469, %455
%475 = load i32, i32* @stderr
%476 = call i32 (i32, i8*, ...) @fprintf(i32 %475, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
br label %477
477: ; preds = %474, %452, %449
%478 = load i32, i32* %9
%479 = add nsw i32 %478, 1
store i32 %479, i32* %9
br label %480
480: ; preds = %477, %424
br label %481
481: ; preds = %480
%482 = load i32, i32* %9
%483 = load i32, i32* %8
%484 = icmp slt i32 %482, %483
br i1 %484, label %340, label %485
485: ; preds = %481
%486 = load i32, i32* %12
%487 = icmp ne i32 %486, 0
br i1 %487, label %488, label %496
488: ; preds = %485
%489 = load i32, i32* %24
%490 = icmp sge i32 %489, 1
br i1 %490, label %491, label %495
491: ; preds = %488
%492 = load i32, i32* @stderr
%493 = load i32, i32* %12
%494 = call i32 (i32, i8*, ...) @fprintf(i32 %492, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0), i32 %493)
br label %495
495: ; preds = %491, %488
store i32 0, i32* %12
br label %496
496: ; preds = %495, %485
%497 = load i32, i32* %13
%498 = icmp ne i32 %497, 0
br i1 %498, label %499, label %507
499: ; preds = %496
%500 = load i32, i32* %24
%501 = icmp sge i32 %500, 1
br i1 %501, label %502, label %506
502: ; preds = %499
%503 = load i32, i32* @stderr
%504 = load i32, i32* %13
%505 = call i32 (i32, i8*, ...) @fprintf(i32 %503, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i32 %504)
br label %506
506: ; preds = %502, %499
store i32 0, i32* %13
br label %507
507: ; preds = %506, %496
%508 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"Ignoring garbage after 'v' characters in arg '%s'\0A\00"
@.str.1 = [8 x i8] c"--clean\00"
@.str.2 = [10 x i8] c"--noclean\00"
@.str.3 = [7 x i8] c"--size\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [48 x i8] c"Couldn't read --size parameter '%s'; ignoring.\0A\00"
@.str.6 = [7 x i8] c"--tail\00"
@.str.7 = [48 x i8] c"Couldn't read --tail parameter '%s'; ignoring.\0A\00"
@.str.8 = [34 x i8] c"Invalid argument '%s'; ignoring.\0A\00"
@.str.9 = [534 x i8] c"Usage: %s [options] { indir | - } { outdir | - }\0A\0AOptions:\0A --size bytes Set target size for mp3 files (mp3dir output only;\0A default 1000000).\0A --tail bytes How far from the end of current.mp3 to start reading\0A (mp3dir input only; default 16384).\0A -v Print more status information to stderr.\0A\0AExamples:\0A %s - - < dirty.mp3 > clean.mp3\0A {generate MP3 stream} | %s --size 99000 - /tmp/mp3dir\0A %s -v --tail 8000 /tmp/mp3dir - | {send to network client}\0A\0AWWW: http://tomclegg.net/mp3cat\0A\0A\00"
@.str.10 = [2 x i8] c"-\00"
@.str.11 = [40 x i8] c"Couldn't allocate %zu bytes; giving up.\00"
@.str.12 = [2 x i8] c"/\00"
@.str.13 = [12 x i8] c"current.mp3\00"
@.str.14 = [14 x i8] c"%d junkbytes\0A\00"
@.str.15 = [11 x i8] c"%d frames\0A\00"
@.str.16 = [8 x i8] c"Found: \00"
@.str.17 = [34 x i8] c"...but the next frame looks wrong\00"
@.str.18 = [24 x i8] c" (version %d, layer %d)\00"
@.str.19 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [8192 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%11 = bitcast i32* %4 to i8*
%12 = bitcast i32* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = icmp sgt i32 %0, 1
br i1 %15, label %16, label %98
16: ; preds = %2
%17 = bitcast i32* %9 to i8*
%18 = bitcast i32* %8 to i8*
br label %19
19: ; preds = %16, %91
%20 = phi i32 [ 1, %16 ], [ %96, %91 ]
%21 = phi i32 [ 0, %16 ], [ %94, %91 ]
%22 = phi i32 [ 16384, %16 ], [ %93, %91 ]
%23 = phi i32 [ 1000000, %16 ], [ %92, %91 ]
%24 = sext i32 %20 to i64
%25 = getelementptr inbounds i8*, i8** %1, i64 %24
%26 = load i8*, i8** %25
%27 = load i8, i8* %26
%28 = icmp eq i8 %27, 45
br i1 %28, label %29, label %98
29: ; preds = %19
%30 = getelementptr inbounds i8, i8* %26, i64 1
%31 = load i8, i8* %30
switch i8 %31, label %43 [
i8 0, label %98
i8 118, label %32
]
32: ; preds = %29, %35
%33 = phi i8 [ %38, %35 ], [ %31, %29 ]
%34 = phi i64 [ %36, %35 ], [ 1, %29 ]
switch i8 %33, label %39 [
i8 118, label %35
i8 0, label %89
]
35: ; preds = %32
%36 = add nuw i64 %34, 1
%37 = getelementptr inbounds i8, i8* %26, i64 %36
%38 = load i8, i8* %37
br label %32
39: ; preds = %32
%40 = trunc i64 %34 to i32
%41 = load i32, i32* @stderr
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %41, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %26)
br label %91
43: ; preds = %29
%44 = call i32 @strcmp(i8* %26, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%45 = icmp eq i32 %44, 0
br i1 %45, label %91, label %46
46: ; preds = %43
%47 = call i32 @strcmp(i8* %26, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%48 = icmp eq i32 %47, 0
br i1 %48, label %91, label %49
49: ; preds = %46
%50 = add nsw i32 %20, 1
%51 = icmp slt i32 %50, %0
br i1 %51, label %52, label %86
52: ; preds = %49
%53 = call i32 @strcmp(i8* %26, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %69
55: ; preds = %52
%56 = sext i32 %50 to i64
%57 = getelementptr inbounds i8*, i8** %1, i64 %56
%58 = load i8*, i8** %57
%59 = call i64 @sscanf(i8* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %8)
%60 = icmp eq i64 %59, 0
br i1 %60, label %63, label %61
61: ; preds = %55
%62 = load i32, i32* %8
br label %67
63: ; preds = %55
%64 = load i32, i32* @stderr
%65 = load i8*, i8** %57
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0), i8* %65)
br label %67
67: ; preds = %63, %61
%68 = phi i32 [ %62, %61 ], [ %23, %63 ]
br label %91
69: ; preds = %52
%70 = call i32 @strcmp(i8* dereferenceable(1) %26, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %86
72: ; preds = %69
%73 = sext i32 %50 to i64
%74 = getelementptr inbounds i8*, i8** %1, i64 %73
%75 = load i8*, i8** %74
%76 = call i64 @sscanf(i8* %75, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %9)
%77 = icmp eq i64 %76, 0
br i1 %77, label %80, label %78
78: ; preds = %72
%79 = load i32, i32* %9
br label %84
80: ; preds = %72
%81 = load i32, i32* @stderr
%82 = load i8*, i8** %74
%83 = call i32 (i32, i8*, ...) @fprintf(i32 %81, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i8* %82)
br label %84
84: ; preds = %80, %78
%85 = phi i32 [ %79, %78 ], [ %22, %80 ]
br label %91
86: ; preds = %49, %69
%87 = load i32, i32* @stderr
%88 = call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i8* %26)
br label %91
89: ; preds = %32
%90 = trunc i64 %34 to i32
br label %91
91: ; preds = %89, %39, %46, %84, %86, %67, %43
%92 = phi i32 [ %23, %39 ], [ %23, %86 ], [ %23, %84 ], [ %68, %67 ], [ %23, %46 ], [ %23, %43 ], [ %23, %89 ]
%93 = phi i32 [ %22, %39 ], [ %22, %86 ], [ %85, %84 ], [ %22, %67 ], [ %22, %46 ], [ %22, %43 ], [ %22, %89 ]
%94 = phi i32 [ %40, %39 ], [ %21, %86 ], [ %21, %84 ], [ %21, %67 ], [ %21, %46 ], [ %21, %43 ], [ %90, %89 ]
%95 = phi i32 [ %20, %39 ], [ %20, %86 ], [ %50, %84 ], [ %50, %67 ], [ %20, %46 ], [ %20, %43 ], [ %20, %89 ]
%96 = add nsw i32 %95, 1
%97 = icmp slt i32 %96, %0
br i1 %97, label %19, label %98
98: ; preds = %19, %91, %29, %2
%99 = phi i32 [ 1000000, %2 ], [ %23, %29 ], [ %92, %91 ], [ %23, %19 ]
%100 = phi i32 [ 16384, %2 ], [ %22, %29 ], [ %93, %91 ], [ %22, %19 ]
%101 = phi i32 [ 0, %2 ], [ %21, %29 ], [ %94, %91 ], [ %21, %19 ]
%102 = phi i32 [ 1, %2 ], [ %20, %29 ], [ %96, %91 ], [ %20, %19 ]
%103 = sub nsw i32 %0, %102
%104 = icmp eq i32 %103, 2
br i1 %104, label %110, label %105
105: ; preds = %98
%106 = load i32, i32* @stderr
%107 = load i8*, i8** %1
%108 = call i32 (i32, i8*, ...) @fprintf(i32 %106, i8* getelementptr inbounds ([534 x i8], [534 x i8]* @.str.9, i64 0, i64 0), i8* %107, i8* %107, i8* %107, i8* %107)
%109 = call i32 @exit(i32 1)
unreachable
110: ; preds = %98
%111 = sext i32 %102 to i64
%112 = getelementptr inbounds i8*, i8** %1, i64 %111
%113 = load i8*, i8** %112
%114 = call i32 @strcmp(i8* dereferenceable(1) %113, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%115 = icmp eq i32 %114, 0
br i1 %115, label %136, label %116
116: ; preds = %110
%117 = call i64 @strlen(i8* dereferenceable(1) %113)
%118 = add i64 %117, 21
%119 = call i8* @malloc(i64 %118)
%120 = icmp eq i8* %119, null
br i1 %120, label %121, label %125
121: ; preds = %116
%122 = load i32, i32* @stderr
%123 = call i32 (i32, i8*, ...) @fprintf(i32 %122, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0), i64 %118)
%124 = call i32 @exit(i32 1)
unreachable
125: ; preds = %116
%126 = call i32 @strcpy(i8* %119, i8* %113)
%127 = call i64 @strlen(i8* %119)
%128 = add i64 %127, -1
%129 = getelementptr inbounds i8, i8* %119, i64 %128
%130 = load i8, i8* %129
%131 = icmp eq i8 %130, 47
br i1 %131, label %134, label %132
132: ; preds = %125
%133 = call i32 @strcat(i8* %119, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %134
134: ; preds = %132, %125
%135 = call i32 @strcat(i8* %119, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
br label %136
136: ; preds = %110, %134
%137 = phi i8* [ %119, %134 ], [ null, %110 ]
%138 = add nsw i32 %102, 1
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i8*, i8** %1, i64 %139
%141 = load i8*, i8** %140
%142 = call i32 @strcmp(i8* dereferenceable(1) %141, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%143 = icmp eq i32 %142, 0
br i1 %143, label %163, label %144
144: ; preds = %136
%145 = call i64 @strlen(i8* dereferenceable(1) %141)
%146 = add i64 %145, 21
%147 = call i8* @malloc(i64 %146)
%148 = icmp eq i8* %147, null
br i1 %148, label %149, label %153
149: ; preds = %144
%150 = load i32, i32* @stderr
%151 = call i32 (i32, i8*, ...) @fprintf(i32 %150, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0), i64 %146)
%152 = call i32 @exit(i32 1)
unreachable
153: ; preds = %144
%154 = call i32 @strcpy(i8* %147, i8* %141)
%155 = call i64 @strlen(i8* %147)
%156 = getelementptr inbounds i8, i8* %147, i64 %155
%157 = load i8, i8* %156
%158 = icmp eq i8 %157, 47
br i1 %158, label %161, label %159
159: ; preds = %153
%160 = call i32 @strcat(i8* %147, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %161
161: ; preds = %159, %153
%162 = call i32 @strcat(i8* %147, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
br label %163
163: ; preds = %136, %161
%164 = phi i8* [ %147, %161 ], [ null, %136 ]
%165 = phi i8* [ %141, %161 ], [ null, %136 ]
%166 = icmp eq i8* %137, null
%167 = icmp sgt i32 %101, 0
%168 = icmp sgt i32 %101, 1
br label %169
169: ; preds = %258, %163
%170 = phi i32 [ 0, %163 ], [ %200, %258 ]
%171 = phi i32 [ 0, %163 ], [ %259, %258 ]
%172 = phi i32 [ undef, %163 ], [ %260, %258 ]
%173 = phi i32 [ 0, %163 ], [ %261, %258 ]
%174 = phi i32 [ 0, %163 ], [ %262, %258 ]
%175 = phi i32 [ 0, %163 ], [ %201, %258 ]
%176 = icmp sgt i32 %171, 2048
br i1 %176, label %177, label %182
177: ; preds = %169
%178 = sub nsw i32 %170, %171
%179 = zext i32 %171 to i64
%180 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 %179
%181 = call i32 @memmove(i8* %10, i8* %180, i32 %178)
br label %182
182: ; preds = %177, %169
%183 = phi i32 [ %178, %177 ], [ %170, %169 ]
%184 = phi i32 [ 0, %177 ], [ %171, %169 ]
%185 = icmp sgt i32 %183, 4096
%186 = icmp ne i32 %175, 0
%187 = select i1 %185, i1 true, i1 %186
br i1 %187, label %199, label %188
188: ; preds = %182
%189 = sext i32 %183 to i64
%190 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 %189
%191 = sub nsw i32 8192, %183
%192 = call i32 @read_buf(i8* %190, i32 %191, i8* %137, i32 %100)
%193 = icmp sgt i32 %192, 0
%194 = select i1 %193, i32 %192, i32 0
%195 = add nsw i32 %183, %194
%196 = xor i1 %193, true
%197 = and i1 %166, %196
%198 = zext i1 %197 to i32
br label %199
199: ; preds = %188, %182
%200 = phi i32 [ %183, %182 ], [ %195, %188 ]
%201 = phi i32 [ %175, %182 ], [ %198, %188 ]
%202 = sext i32 %184 to i64
%203 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 %202
%204 = sub nsw i32 %200, %184
%205 = call i32 @frame_length(i8* %203, i32 %204, i32 0, i32* %5, i32* %4)
%206 = icmp sgt i32 %205, 0
br i1 %206, label %207, label %231
207: ; preds = %199
%208 = add nsw i32 %205, %184
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 %209
%211 = sub nsw i32 %204, %205
%212 = call i32 @frame_length(i8* %210, i32 %211, i32 0, i32* %7, i32* %6)
%213 = icmp eq i32 %212, 0
br i1 %213, label %231, label %214
214: ; preds = %207
%215 = load i32, i32* %7
%216 = load i32, i32* %5
%217 = icmp eq i32 %215, %216
br i1 %217, label %218, label %231
218: ; preds = %214
%219 = load i32, i32* %6
%220 = load i32, i32* %4
%221 = icmp eq i32 %219, %220
br i1 %221, label %222, label %231
222: ; preds = %218
%223 = add nsw i32 %174, 1
%224 = icmp ne i32 %173, 0
%225 = select i1 %224, i1 %167, i1 false
br i1 %225, label %226, label %229
226: ; preds = %222
%227 = load i32, i32* @stderr
%228 = call i32 (i32, i8*, ...) @fprintf(i32 %227, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0), i32 %173)
br label %229
229: ; preds = %226, %222
%230 = call i32 @write_buf(i8* %203, i32 %205, i8* %164, i8* %165, i32 %99)
br label %258
231: ; preds = %218, %214, %207, %199
%232 = phi i32 [ %212, %218 ], [ %212, %214 ], [ 0, %207 ], [ %172, %199 ]
%233 = add nsw i32 %173, 1
%234 = icmp ne i32 %174, 0
%235 = select i1 %234, i1 %167, i1 false
br i1 %235, label %236, label %239
236: ; preds = %231
%237 = load i32, i32* @stderr
%238 = call i32 (i32, i8*, ...) @fprintf(i32 %237, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i32 %174)
br label %239
239: ; preds = %236, %231
%240 = select i1 %168, i1 %206, i1 false
br i1 %240, label %241, label %256
241: ; preds = %239
%242 = load i32, i32* @stderr
%243 = call i32 (i32, i8*, ...) @fprintf(i32 %242, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
%244 = call i32 @frame_length(i8* %203, i32 %204, i32 1, i32* %5, i32* %4)
%245 = load i32, i32* @stderr
%246 = call i32 (i32, i8*, ...) @fprintf(i32 %245, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.17, i64 0, i64 0))
%247 = icmp eq i32 %232, 0
br i1 %247, label %253, label %248
248: ; preds = %241
%249 = load i32, i32* @stderr
%250 = load i32, i32* %7
%251 = load i32, i32* %6
%252 = call i32 (i32, i8*, ...) @fprintf(i32 %249, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.18, i64 0, i64 0), i32 %250, i32 %251)
br label %253
253: ; preds = %248, %241
%254 = load i32, i32* @stderr
%255 = call i32 (i32, i8*, ...) @fprintf(i32 %254, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
br label %256
256: ; preds = %253, %239
%257 = add nsw i32 %184, 1
br label %258
258: ; preds = %229, %256
%259 = phi i32 [ %208, %229 ], [ %257, %256 ]
%260 = phi i32 [ %212, %229 ], [ %232, %256 ]
%261 = phi i32 [ 0, %229 ], [ %233, %256 ]
%262 = phi i32 [ %223, %229 ], [ 0, %256 ]
%263 = icmp slt i32 %259, %200
br i1 %263, label %169, label %264
264: ; preds = %258
%265 = icmp ne i32 %261, 0
%266 = select i1 %265, i1 %167, i1 false
br i1 %266, label %267, label %270
267: ; preds = %264
%268 = load i32, i32* @stderr
%269 = call i32 (i32, i8*, ...) @fprintf(i32 %268, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0), i32 %261)
br label %270
270: ; preds = %267, %264
%271 = icmp ne i32 %262, 0
%272 = select i1 %271, i1 %167, i1 false
br i1 %272, label %273, label %276
273: ; preds = %270
%274 = load i32, i32* @stderr
%275 = call i32 (i32, i8*, ...) @fprintf(i32 %274, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i32 %262)
br label %276
276: ; preds = %273, %270
%277 = call i32 @exit(i32 0)
unreachable
}