#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
long atol(char *);
int convertHash(char *, size_t, unsigned char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int ferror(int /*<<< orphan*/ *);
char *fgets(char *, int const, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(void *);
size_t fwrite(unsigned char *, size_t, int, int /*<<< orphan*/ *);
int hashLen(char *);
void *malloc(int const);
int /*<<< orphan*/ setbuffer(int /*<<< orphan*/ *, void *, size_t);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
int /*<<< orphan*/ strcmp(char *, char *);
char *strerror(int);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  FILE *inp = stdin;
  FILE *out = stdout;
  size_t rawSize = 0;
  int printUsage = 0;
  int ret = 0;
  int i = 0;
  unsigned converted = 0;
  char *lineBuf = NULL;
  unsigned char *binBuf = NULL;
  size_t vBufSize = 0;
  void *rdBuffer = NULL;
  void *wrBuffer = NULL;
  while (1) {
    for (i = 1; i < argc; ++i) {
      if (!strcmp(argv[i], "-n") && i + 1 < argc) {
        int tmp = atoi(argv[i + 1]);
        if (tmp <= 0) {
          fprintf(stderr,
                  "error: rawSize (value for '-n' = '%s') must be > 0 !\n",
                  argv[i + 1]);
          ret = 10;
          break;
        }
        rawSize = tmp;
        ++i;
      } else if (!strcmp(argv[i], "-B") && i + 1 < argc) {
        vBufSize = (size_t)(atol(argv[i + 1]) * 1024L);
        ++i;
      } else if (!strcmp(argv[i], "-i") && i + 1 < argc) {
        inp = fopen(argv[i + 1], "r");
        if (!inp) {
          fprintf(stderr, "error: input file '%s' could not be opened!\n",
                  argv[i + 1]);
          ret = 10;
          break;
        }
        ++i;
      } else if (!strcmp(argv[i], "-o") && i + 1 < argc) {
        out = fopen(argv[i + 1], "wb");
        if (!out) {
          fprintf(stderr, "error: output file '%s' could not be opened!\n",
                  argv[i + 1]);
          ret = 10;
          break;
        }
        ++i;
      } else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
        printUsage = 1;
      } else {
        fprintf(stderr, "error: ignoring option '%s'!\n", argv[i]);
        printUsage = 1;
      }
    }
    if (ret)
      break;
    if (printUsage) {
      usage();
      ret = 1;
      break;
    }
    const int bufLen = (rawSize > 0) ? (rawSize * 3 + 16) : 1024;
    free(lineBuf);
    lineBuf = malloc(bufLen * sizeof(char));
    if (!lineBuf) {
      fprintf(stderr, "error allocating line buffer of %u bytes!\n",
              (unsigned)(bufLen * sizeof(char)));
      ret = 10;
      break;
    }
    if (rawSize > 0) {
      free(binBuf);
      binBuf = (unsigned char *)malloc(rawSize * sizeof(unsigned char));
      if (!binBuf) {
        fprintf(stderr, "error allocating binary buffer of %u bytes!\n",
                (unsigned)(rawSize * sizeof(unsigned char)));
        ret = 10;
        break;
      }
    }
    int lineNo = 0;
    {
      size_t bufferSize = vBufSize ? vBufSize : 65536;
      rdBuffer = malloc(bufferSize);
      wrBuffer = malloc(bufferSize);
      if (rdBuffer)
        setbuffer(inp, rdBuffer, bufferSize);
      if (wrBuffer)
        setbuffer(out, wrBuffer, bufferSize);
    }
    while (!ret && !feof(inp)) {
      char *r = fgets(lineBuf, bufLen, inp);
      if (r) {
        ++lineNo;
        if (!rawSize) {
          const int len = hashLen(lineBuf);
          if (len <= 0 || (len & 1)) {
            fprintf(
                stderr,
                "error: hexadecimal length of 1st line (=%d) must be even!\n",
                len);
            ret = 10;
            break;
          }
          rawSize = len / 2;
          fprintf(stderr,
                  "info: using rawSize %d from 1st line with hexLen %d\n",
                  (int)rawSize, len);
          free(binBuf);
          binBuf = (unsigned char *)malloc(rawSize * sizeof(unsigned char));
          if (!binBuf) {
            fprintf(stderr, "error allocating binary buffer of %u bytes!\n",
                    (unsigned)(rawSize * sizeof(unsigned char)));
            ret = 10;
            break;
          }
        }
        int bLen = convertHash(lineBuf, rawSize, binBuf);
        if (!bLen) {
        } else if (bLen < 0 || (size_t)bLen != rawSize) {
          fprintf(stderr,
                  "warning: hexadecimal length %d of line %d does not match "
                  "expected value of %d! skipping line '%s'\n",
                  bLen, lineNo, (int)rawSize, lineBuf);
        } else {
          size_t w = fwrite(binBuf, rawSize, 1, out);
          if (w != 1) {
            int ferr = ferror(out);
            if (ferr)
              fprintf(stderr,
                      "error %d writing binary for line %d to output!: %s\n",
                      ferr, lineNo, strerror(ferr));
            else
              fprintf(stderr,
                      "error %d writing binary for line %d to output!\n", ferr,
                      lineNo);
            ret = 10;
            break;
          }
          ++converted;
        }
      }
    }
    break;
  }
  free(lineBuf);
  free(binBuf);
  if (converted)
    fprintf(stderr, "successfully converted %u hexadecimal lines.\n",
            converted);
  if (out != stdout) {
    fclose(out);
    free(wrBuffer);
  }
  if (inp != stdin) {
    fclose(inp);
    free(rdBuffer);
  }
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2db8(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2d92(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1578 <main+0x368>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd49(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    1341 <main+0x131>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    1341 <main+0x131>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1110 <atoi@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
jg     132b <main+0x11b>
mov    0x2cda(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xceb(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xa,-0x30(%rbp)
jmp    1578 <main+0x368>
movslq -0x64(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1565 <main+0x355>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xce5(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    139d <main+0x18d>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    139d <main+0x18d>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   10e0 <atol@plt>
shl    $0xa,%rax
mov    %rax,-0x50(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1560 <main+0x350>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc8c(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    143b <main+0x22b>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    143b <main+0x22b>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc5a(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    142d <main+0x21d>
mov    0x2bd8(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc27(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xa,-0x30(%rbp)
jmp    1578 <main+0x368>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    155b <main+0x34b>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xc20(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    14d9 <main+0x2c9>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    14d9 <main+0x2c9>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbee(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    14cb <main+0x2bb>
mov    0x2b3a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xbbc(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xa,-0x30(%rbp)
jmp    1578 <main+0x368>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1556 <main+0x346>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xbb6(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
je     151b <main+0x30b>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xb98(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    1527 <main+0x317>
movl   $0x1,-0x2c(%rbp)
jmp    1551 <main+0x341>
mov    0x2aaa(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xb69(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x2c(%rbp)
jmp    1556 <main+0x346>
jmp    155b <main+0x34b>
jmp    1560 <main+0x350>
jmp    1565 <main+0x355>
jmp    156a <main+0x35a>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1298 <main+0x88>
cmpl   $0x0,-0x30(%rbp)
je     1587 <main+0x377>
jmp    19e4 <main+0x7d4>
cmpl   $0x0,-0x2c(%rbp)
je     15a4 <main+0x394>
mov    $0x0,%al
call   10d0 <usage@plt>
movl   $0x1,-0x30(%rbp)
jmp    19e4 <main+0x7d4>
cmpq   $0x0,-0x28(%rbp)
jbe    15c4 <main+0x3b4>
imul   $0x3,-0x28(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0xa0(%rbp)
jmp    15d5 <main+0x3c5>
mov    $0x400,%eax
mov    %rax,-0xa0(%rbp)
jmp    15d5 <main+0x3c5>
mov    -0xa0(%rbp),%rax
mov    %eax,-0x68(%rbp)
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movslq -0x68(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1633 <main+0x423>
mov    0x29cb(%rip),%rax
mov    (%rax),%edi
movslq -0x68(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edx
lea    0xaaa(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xa,-0x30(%rbp)
jmp    19e4 <main+0x7d4>
cmpq   $0x0,-0x28(%rbp)
jbe    1697 <main+0x487>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1692 <main+0x482>
mov    0x296c(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edx
lea    0xa76(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xa,-0x30(%rbp)
jmp    19e4 <main+0x7d4>
jmp    1697 <main+0x487>
movl   $0x0,-0x6c(%rbp)
cmpq   $0x0,-0x50(%rbp)
je     16b9 <main+0x4a9>
mov    -0x50(%rbp),%rax
mov    %rax,-0xa8(%rbp)
jmp    16ca <main+0x4ba>
mov    $0x10000,%eax
mov    %rax,-0xa8(%rbp)
jmp    16ca <main+0x4ba>
mov    -0xa8(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x78(%rbp),%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     170f <main+0x4ff>
mov    -0x18(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x78(%rbp),%rdx
call   1060 <setbuffer@plt>
cmpq   $0x0,-0x60(%rbp)
je     172b <main+0x51b>
mov    -0x20(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x78(%rbp),%rdx
call   1060 <setbuffer@plt>
jmp    1730 <main+0x520>
xor    %eax,%eax
cmpl   $0x0,-0x30(%rbp)
mov    %al,-0xa9(%rbp)
jne    1759 <main+0x549>
mov    -0x18(%rbp),%rdi
call   10a0 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0xa9(%rbp)
mov    -0xa9(%rbp),%al
test   $0x1,%al
jne    176c <main+0x55c>
jmp    19df <main+0x7cf>
mov    -0x40(%rbp),%rdi
mov    -0x68(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1070 <fgets@plt>
mov    %rax,-0x80(%rbp)
cmpq   $0x0,-0x80(%rbp)
je     19da <main+0x7ca>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1886 <main+0x676>
mov    -0x40(%rbp),%rdi
call   1100 <hashLen@plt>
mov    %eax,-0x84(%rbp)
cmpl   $0x0,-0x84(%rbp)
jle    17cd <main+0x5bd>
mov    -0x84(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     17f6 <main+0x5e6>
mov    0x2804(%rip),%rax
mov    (%rax),%edi
mov    -0x84(%rbp),%edx
lea    0x93f(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xa,-0x30(%rbp)
jmp    19df <main+0x7cf>
mov    -0x84(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0x28(%rbp)
mov    0x27c7(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
mov    %eax,%edx
mov    -0x84(%rbp),%ecx
lea    0x937(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   10c0 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1881 <main+0x671>
mov    0x277d(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edx
lea    0x887(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xa,-0x30(%rbp)
jmp    19df <main+0x7cf>
jmp    1886 <main+0x676>
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x48(%rbp),%rdx
call   10b0 <convertHash@plt>
mov    %eax,-0x88(%rbp)
cmpl   $0x0,-0x88(%rbp)
jne    18af <main+0x69f>
jmp    19d5 <main+0x7c5>
cmpl   $0x0,-0x88(%rbp)
jl     18cd <main+0x6bd>
movslq -0x88(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     18fd <main+0x6ed>
mov    0x2704(%rip),%rax
mov    (%rax),%edi
mov    -0x88(%rbp),%edx
mov    -0x6c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %eax,%r8d
mov    -0x40(%rbp),%r9
lea    0x8a1(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    19d0 <main+0x7c0>
mov    -0x48(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1120 <fwrite@plt>
mov    %rax,-0x90(%rbp)
cmpq   $0x1,-0x90(%rbp)
01
je     19c7 <main+0x7b7>
mov    -0x20(%rbp),%rdi
call   1040 <ferror@plt>
mov    %eax,-0x94(%rbp)
cmpl   $0x0,-0x94(%rbp)
je     199b <main+0x78b>
mov    0x268d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xb8(%rbp)
mov    -0x94(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0xb0(%rbp)
mov    -0x94(%rbp),%edi
call   1130 <strerror@plt>
mov    -0xb8(%rbp),%edi
mov    -0xb4(%rbp),%edx
mov    -0xb0(%rbp),%ecx
mov    %rax,%r8
lea    0x866(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    19bb <main+0x7ab>
mov    0x2636(%rip),%rax
mov    (%rax),%edi
mov    -0x94(%rbp),%edx
mov    -0x6c(%rbp),%ecx
lea    0x875(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xa,-0x30(%rbp)
jmp    19df <main+0x7cf>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    19d5 <main+0x7c5>
jmp    19da <main+0x7ca>
jmp    1730 <main+0x520>
jmp    19e4 <main+0x7d4>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x38(%rbp)
je     1a1a <main+0x80a>
mov    0x25d1(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%edx
lea    0x846(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%rax
mov    0x25ab(%rip),%rcx
cmp    (%rcx),%rax
je     1a40 <main+0x830>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
mov    0x259d(%rip),%rcx
cmp    (%rcx),%rax
je     1a66 <main+0x856>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    0x2dc3(%rip),%r14
mov    (%r14),%rax
mov    %rax,0x28(%rsp)
mov    0x2d9c(%rip),%rbp
mov    0x0(%rbp),%rax
mov    %rax,(%rsp)
cmp    $0x2,%edi
jl     1403 <main+0x1f3>
mov    %rsi,%r15
mov    %edi,%ebx
mov    $0x1,%ebp
xor    %eax,%eax
mov    %rax,0x30(%rsp)
xor    %r14d,%r14d
xor    %eax,%eax
mov    %rax,0x10(%rsp)
jmp    1283 <main+0x73>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%r13d
add    $0x1,%r13d
mov    %r13d,%ebp
cmp    %ebx,%r13d
jge    140e <main+0x1fe>
movslq %ebp,%rax
mov    (%r15,%rax,8),%r12
mov    %r12,%rdi
lea    0xd6c(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
jne    12d0 <main+0xc0>
lea    0x1(%rbp),%r13d
cmp    %ebx,%r13d
jge    12d0 <main+0xc0>
movslq %r13d,%rax
mov    (%r15,%rax,8),%rbp
mov    %rbp,%rdi
call   1110 <atoi@plt>
test   %eax,%eax
jle    16c6 <main+0x4b6>
mov    %eax,%eax
mov    %rax,0x30(%rsp)
jmp    1273 <main+0x63>
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
lea    0xd5f(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
jne    1310 <main+0x100>
lea    0x1(%rbp),%r13d
cmp    %ebx,%r13d
jge    1310 <main+0x100>
movslq %r13d,%rax
mov    (%r15,%rax,8),%rdi
call   10e0 <atol@plt>
shl    $0xa,%rax
mov    %rax,0x10(%rsp)
jmp    1273 <main+0x63>
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
lea    0xd22(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
jne    1360 <main+0x150>
lea    0x1(%rbp),%r13d
cmp    %ebx,%r13d
jge    1360 <main+0x150>
movslq %r13d,%rbp
mov    (%r15,%rbp,8),%rdi
lea    0xd05(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,%rcx
mov    %rax,0x28(%rsp)
test   %rax,%rax
jne    1273 <main+0x63>
jmp    16ea <main+0x4da>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
lea    0xd04(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
jne    13b0 <main+0x1a0>
lea    0x1(%rbp),%r13d
cmp    %ebx,%r13d
jge    13b0 <main+0x1a0>
movslq %r13d,%rbp
mov    (%r15,%rbp,8),%rdi
lea    0xce7(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,(%rsp)
test   %rax,%rax
jne    1273 <main+0x63>
jmp    173f <main+0x52f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
lea    0xce8(%rip),%rsi
call   1080 <strcmp@plt>
mov    $0x1,%r14d
test   %eax,%eax
je     1270 <main+0x60>
mov    %r12,%rdi
lea    0xcce(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
je     1270 <main+0x60>
mov    0x2bed(%rip),%rax
mov    (%rax),%edi
lea    0xcb8(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    1270 <main+0x60>
xor    %ebx,%ebx
xor    %eax,%eax
mov    %rax,0x10(%rsp)
jmp    143a <main+0x22a>
test   %r14d,%r14d
je     1427 <main+0x217>
xor    %eax,%eax
call   10d0 <usage@plt>
xor    %edi,%edi
mov    $0x1,%r15d
jmp    1714 <main+0x504>
mov    0x2bba(%rip),%r14
mov    0x2b9b(%rip),%rbp
mov    0x30(%rsp),%rbx
test   %rbx,%rbx
lea    0x10(%rbx,%rbx,2),%eax
mov    $0x400,%r15d
cmovne %eax,%r15d
xor    %edi,%edi
call   1030 <free@plt>
mov    %r15d,%edi
call   10c0 <malloc@plt>
test   %rax,%rax
je     14c8 <main+0x2b8>
mov    %rax,0x8(%rsp)
test   %rbx,%rbx
je     1507 <main+0x2f7>
xor    %r12d,%r12d
xor    %edi,%edi
call   1030 <free@plt>
mov    %ebx,%edi
call   10c0 <malloc@plt>
mov    %rax,%r13
test   %rax,%rax
jne    150a <main+0x2fa>
mov    0x2b47(%rip),%rax
mov    (%rax),%edi
lea    0xc5b(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xa,%r15d
xor    %r13d,%r13d
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
mov    (%rsp),%rbx
mov    0x8(%rsp),%rdi
jmp    1837 <main+0x627>
mov    0x2b09(%rip),%rax
mov    (%rax),%edi
lea    0xbf2(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xa,%r15d
xor    %edi,%edi
xor    %r12d,%r12d
xor    %r13d,%r13d
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
mov    (%rsp),%rbx
jmp    1837 <main+0x627>
xor    %r13d,%r13d
mov    %rbx,0x30(%rsp)
mov    0x10(%rsp),%rax
test   %rax,%rax
mov    $0x10000,%ebx
cmovne %rax,%rbx
mov    %ebx,%edi
call   10c0 <malloc@plt>
mov    %rax,%r12
mov    %ebx,%edi
call   10c0 <malloc@plt>
test   %r12,%r12
mov    %rax,%rcx
mov    %rax,0x18(%rsp)
je     1553 <main+0x343>
mov    0x28(%rsp),%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1060 <setbuffer@plt>
mov    0x18(%rsp),%rax
mov    %r12,0x10(%rsp)
test   %rax,%rax
je     156c <main+0x35c>
mov    %rax,%rsi
mov    (%rsp),%rdi
mov    %rbx,%rdx
call   1060 <setbuffer@plt>
mov    0x28(%rsp),%rdi
call   10a0 <feof@plt>
test   %eax,%eax
je     158e <main+0x37e>
xor    %r15d,%r15d
mov    (%rsp),%rbx
mov    0x8(%rsp),%rdi
xor    %r12d,%r12d
jmp    1837 <main+0x627>
mov    0x2a43(%rip),%r12
xor    %r14d,%r14d
xor    %eax,%eax
mov    %rax,0x20(%rsp)
mov    0x28(%rsp),%rbp
mov    0x30(%rsp),%rbx
mov    0x8(%rsp),%rdi
jmp    15e5 <main+0x3d5>
mov    (%r12),%edi
lea    0xbd7(%rip),%rsi
mov    %eax,%edx
mov    %r14d,%ecx
mov    %ebx,%r8d
mov    0x8(%rsp),%r9
xor    %eax,%eax
call   1090 <fprintf@plt>
nop
mov    %rbp,%rdi
call   10a0 <feof@plt>
test   %eax,%eax
mov    0x8(%rsp),%rdi
jne    16ac <main+0x49c>
mov    %r15d,%esi
mov    %rbp,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     15d0 <main+0x3c0>
test   %rbx,%rbx
jne    164e <main+0x43e>
mov    0x8(%rsp),%rdi
call   1100 <hashLen@plt>
test   %eax,%eax
jle    178b <main+0x57b>
mov    %eax,%ecx
and    $0x1,%ecx
jne    178b <main+0x57b>
mov    %eax,%ebx
shr    %ebx
mov    (%r12),%edi
lea    0xb37(%rip),%rsi
mov    %ebx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %ebx,%edi
call   10c0 <malloc@plt>
test   %rax,%rax
je     179a <main+0x58a>
mov    %rax,%r13
mov    %ebx,%ebx
mov    0x8(%rsp),%rdi
add    $0x1,%r14d
mov    %rbx,%rsi
mov    %r13,%rdx
call   10b0 <convertHash@plt>
test   %eax,%eax
je     15d0 <main+0x3c0>
js     15b0 <main+0x3a0>
movslq %eax,%rcx
cmp    %rcx,%rbx
jne    15b0 <main+0x3a0>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    (%rsp),%rcx
call   1120 <fwrite@plt>
cmp    $0x1,%rax
jne    17cb <main+0x5bb>
mov    0x20(%rsp),%rax
add    $0x1,%eax
mov    %rax,0x20(%rsp)
jmp    15d0 <main+0x3c0>
xor    %r15d,%r15d
mov    0x2932(%rip),%r14
mov    0x2913(%rip),%rbp
mov    (%rsp),%rbx
jmp    1832 <main+0x622>
mov    0x290b(%rip),%rax
mov    (%rax),%edi
lea    0x92d(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
xor    %edi,%edi
mov    $0xa,%r15d
jmp    1714 <main+0x504>
mov    0x28e7(%rip),%rax
mov    (%rax),%edi
mov    (%r15,%rbp,8),%rdx
lea    0x943(%rip),%rsi
xor    %eax,%eax
mov    %rax,0x28(%rsp)
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xa,%r15d
xor    %edi,%edi
xor    %r13d,%r13d
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %r12d,%r12d
mov    0x28b9(%rip),%r14
mov    0x289a(%rip),%rbp
mov    (%rsp),%rbx
jmp    1837 <main+0x627>
mov    0x2892(%rip),%rax
mov    (%rax),%edi
mov    (%r15,%rbp,8),%rdx
lea    0x921(%rip),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xa,%r15d
xor    %edi,%edi
xor    %r13d,%r13d
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %r12d,%r12d
mov    0x2869(%rip),%r14
mov    0x284a(%rip),%rbp
jmp    1837 <main+0x627>
mov    (%r12),%edi
lea    0x98c(%rip),%rsi
mov    %eax,%edx
jmp    17aa <main+0x59a>
mov    (%r12),%edi
lea    0x950(%rip),%rsi
xor    %r13d,%r13d
mov    %ebx,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xa,%r15d
mov    0x282a(%rip),%r14
mov    0x280b(%rip),%rbp
mov    (%rsp),%rbx
jmp    182d <main+0x61d>
mov    (%rsp),%rbx
mov    %rbx,%rdi
call   1040 <ferror@plt>
mov    (%r12),%r15d
test   %eax,%eax
je     1803 <main+0x5f3>
mov    %eax,%ebp
mov    %eax,%edi
call   1130 <strerror@plt>
lea    0xa06(%rip),%rsi
mov    %r15d,%edi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %rax,%r8
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    1819 <main+0x609>
lea    0xa1f(%rip),%rsi
mov    %r15d,%edi
xor    %edx,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xa,%r15d
mov    0x27c2(%rip),%r14
mov    0x27a3(%rip),%rbp
mov    0x8(%rsp),%rdi
mov    0x20(%rsp),%r12
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
test   %r12d,%r12d
je     1863 <main+0x653>
mov    0x2788(%rip),%rax
mov    (%rax),%edi
lea    0xa00(%rip),%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
cmp    0x0(%rbp),%rbx
mov    0x10(%rsp),%rbp
je     1880 <main+0x670>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
cmp    (%r14),%rdi
je     1897 <main+0x687>
call   1050 <fclose@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r15d,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32* null
@.str = [3 x i8] c"-n\00"
@stderr = global i32 0
@.str.1 = [54 x i8] c"error: rawSize (value for '-n' = '%s') must be > 0 !\0A\00"
@.str.2 = [3 x i8] c"-B\00"
@.str.3 = [3 x i8] c"-i\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [45 x i8] c"error: input file '%s' could not be opened!\0A\00"
@.str.6 = [3 x i8] c"-o\00"
@.str.7 = [3 x i8] c"wb\00"
@.str.8 = [46 x i8] c"error: output file '%s' could not be opened!\0A\00"
@.str.9 = [3 x i8] c"-h\00"
@.str.10 = [7 x i8] c"--help\00"
@.str.11 = [30 x i8] c"error: ignoring option '%s'!\0A\00"
@.str.12 = [43 x i8] c"error allocating line buffer of %u bytes!\0A\00"
@.str.13 = [45 x i8] c"error allocating binary buffer of %u bytes!\0A\00"
@.str.14 = [59 x i8] c"error: hexadecimal length of 1st line (=%d) must be even!\0A\00"
@.str.15 = [53 x i8] c"info: using rawSize %d from 1st line with hexLen %d\0A\00"
@.str.16 = [99 x i8] c"warning: hexadecimal length %d of line %d does not match expected value of %d! skipping line '%s'\0A\00"
@.str.17 = [52 x i8] c"error %d writing binary for line %d to output!: %s\0A\00"
@.str.18 = [48 x i8] c"error %d writing binary for line %d to output!\0A\00"
@.str.19 = [46 x i8] c"successfully converted %u hexadecimal lines.\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 i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i64
%22 = alloca i8*
%23 = alloca i32
%24 = alloca i32
%25 = alloca i64
%26 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%27 = load i32*, i32** @stdin
store i32* %27, i32** %6
%28 = load i32*, i32** @stdout
store i32* %28, i32** %7
store i64 0, i64* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i8* null, i8** %13
store i8* null, i8** %14
store i64 0, i64* %15
store i8* null, i8** %16
store i8* null, i8** %17
br label %29
29: ; preds = %2
store i32 1, i32* %11
br label %30
30: ; preds = %195, %29
%31 = load i32, i32* %11
%32 = load i32, i32* %4
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %198
34: ; preds = %30
%35 = load i8**, i8*** %5
%36 = load i32, i32* %11
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %35, i64 %37
%39 = load i8*, i8** %38
%40 = call i32 @strcmp(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%41 = icmp ne i32 %40, 0
br i1 %41, label %71, label %42
42: ; preds = %34
%43 = load i32, i32* %11
%44 = add nsw i32 %43, 1
%45 = load i32, i32* %4
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %71
47: ; preds = %42
%48 = load i8**, i8*** %5
%49 = load i32, i32* %11
%50 = add nsw i32 %49, 1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %48, i64 %51
%53 = load i8*, i8** %52
%54 = call i32 @atoi(i8* %53)
store i32 %54, i32* %18
%55 = load i32, i32* %18
%56 = icmp sle i32 %55, 0
br i1 %56, label %57, label %66
57: ; preds = %47
%58 = load i32, i32* @stderr
%59 = load i8**, i8*** %5
%60 = load i32, i32* %11
%61 = add nsw i32 %60, 1
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8*, i8** %59, i64 %62
%64 = load i8*, i8** %63
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i8* %64)
store i32 10, i32* %10
br label %198
66: ; preds = %47
%67 = load i32, i32* %18
%68 = sext i32 %67 to i64
store i64 %68, i64* %8
%69 = load i32, i32* %11
%70 = add nsw i32 %69, 1
store i32 %70, i32* %11
br label %194
71: ; preds = %42, %34
%72 = load i8**, i8*** %5
%73 = load i32, i32* %11
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8*, i8** %72, i64 %74
%76 = load i8*, i8** %75
%77 = call i32 @strcmp(i8* %76, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%78 = icmp ne i32 %77, 0
br i1 %78, label %95, label %79
79: ; preds = %71
%80 = load i32, i32* %11
%81 = add nsw i32 %80, 1
%82 = load i32, i32* %4
%83 = icmp slt i32 %81, %82
br i1 %83, label %84, label %95
84: ; preds = %79
%85 = load i8**, i8*** %5
%86 = load i32, i32* %11
%87 = add nsw i32 %86, 1
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8*, i8** %85, i64 %88
%90 = load i8*, i8** %89
%91 = call i64 @atol(i8* %90)
%92 = mul nsw i64 %91, 1024
store i64 %92, i64* %15
%93 = load i32, i32* %11
%94 = add nsw i32 %93, 1
store i32 %94, i32* %11
br label %193
95: ; preds = %79, %71
%96 = load i8**, i8*** %5
%97 = load i32, i32* %11
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i8*, i8** %96, i64 %98
%100 = load i8*, i8** %99
%101 = call i32 @strcmp(i8* %100, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%102 = icmp ne i32 %101, 0
br i1 %102, label %130, label %103
103: ; preds = %95
%104 = load i32, i32* %11
%105 = add nsw i32 %104, 1
%106 = load i32, i32* %4
%107 = icmp slt i32 %105, %106
br i1 %107, label %108, label %130
108: ; preds = %103
%109 = load i8**, i8*** %5
%110 = load i32, i32* %11
%111 = add nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8*, i8** %109, i64 %112
%114 = load i8*, i8** %113
%115 = call i32* @fopen(i8* %114, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %115, i32** %6
%116 = load i32*, i32** %6
%117 = icmp ne i32* %116, null
br i1 %117, label %127, label %118
118: ; preds = %108
%119 = load i32, i32* @stderr
%120 = load i8**, i8*** %5
%121 = load i32, i32* %11
%122 = add nsw i32 %121, 1
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds i8*, i8** %120, i64 %123
%125 = load i8*, i8** %124
%126 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0), i8* %125)
store i32 10, i32* %10
br label %198
127: ; preds = %108
%128 = load i32, i32* %11
%129 = add nsw i32 %128, 1
store i32 %129, i32* %11
br label %192
130: ; preds = %103, %95
%131 = load i8**, i8*** %5
%132 = load i32, i32* %11
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i8*, i8** %131, i64 %133
%135 = load i8*, i8** %134
%136 = call i32 @strcmp(i8* %135, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%137 = icmp ne i32 %136, 0
br i1 %137, label %165, label %138
138: ; preds = %130
%139 = load i32, i32* %11
%140 = add nsw i32 %139, 1
%141 = load i32, i32* %4
%142 = icmp slt i32 %140, %141
br i1 %142, label %143, label %165
143: ; preds = %138
%144 = load i8**, i8*** %5
%145 = load i32, i32* %11
%146 = add nsw i32 %145, 1
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i8*, i8** %144, i64 %147
%149 = load i8*, i8** %148
%150 = call i32* @fopen(i8* %149, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
store i32* %150, i32** %7
%151 = load i32*, i32** %7
%152 = icmp ne i32* %151, null
br i1 %152, label %162, label %153
153: ; preds = %143
%154 = load i32, i32* @stderr
%155 = load i8**, i8*** %5
%156 = load i32, i32* %11
%157 = add nsw i32 %156, 1
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds i8*, i8** %155, i64 %158
%160 = load i8*, i8** %159
%161 = call i32 (i32, i8*, ...) @fprintf(i32 %154, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i8* %160)
store i32 10, i32* %10
br label %198
162: ; preds = %143
%163 = load i32, i32* %11
%164 = add nsw i32 %163, 1
store i32 %164, i32* %11
br label %191
165: ; preds = %138, %130
%166 = load i8**, i8*** %5
%167 = load i32, i32* %11
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds i8*, i8** %166, i64 %168
%170 = load i8*, i8** %169
%171 = call i32 @strcmp(i8* %170, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%172 = icmp ne i32 %171, 0
br i1 %172, label %173, label %181
173: ; preds = %165
%174 = load i8**, i8*** %5
%175 = load i32, i32* %11
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds i8*, i8** %174, i64 %176
%178 = load i8*, i8** %177
%179 = call i32 @strcmp(i8* %178, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%180 = icmp ne i32 %179, 0
br i1 %180, label %182, label %181
181: ; preds = %173, %165
store i32 1, i32* %9
br label %190
182: ; preds = %173
%183 = load i32, i32* @stderr
%184 = load i8**, i8*** %5
%185 = load i32, i32* %11
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds i8*, i8** %184, i64 %186
%188 = load i8*, i8** %187
%189 = call i32 (i32, i8*, ...) @fprintf(i32 %183, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i8* %188)
store i32 1, i32* %9
br label %190
190: ; preds = %182, %181
br label %191
191: ; preds = %190, %162
br label %192
192: ; preds = %191, %127
br label %193
193: ; preds = %192, %84
br label %194
194: ; preds = %193, %66
br label %195
195: ; preds = %194
%196 = load i32, i32* %11
%197 = add nsw i32 %196, 1
store i32 %197, i32* %11
br label %30
198: ; preds = %153, %118, %57, %30
%199 = load i32, i32* %10
%200 = icmp ne i32 %199, 0
br i1 %200, label %201, label %202
201: ; preds = %198
br label %398
202: ; preds = %198
%203 = load i32, i32* %9
%204 = icmp ne i32 %203, 0
br i1 %204, label %205, label %207
205: ; preds = %202
%206 = call i32 (...) @usage()
store i32 1, i32* %10
br label %398
207: ; preds = %202
%208 = load i64, i64* %8
%209 = icmp ugt i64 %208, 0
br i1 %209, label %210, label %214
210: ; preds = %207
%211 = load i64, i64* %8
%212 = mul i64 %211, 3
%213 = add i64 %212, 16
br label %215
214: ; preds = %207
br label %215
215: ; preds = %214, %210
%216 = phi i64 [ %213, %210 ], [ 1024, %214 ]
%217 = trunc i64 %216 to i32
store i32 %217, i32* %19
%218 = load i8*, i8** %13
%219 = call i32 @free(i8* %218)
%220 = load i32, i32* %19
%221 = sext i32 %220 to i64
%222 = mul i64 %221, 1
%223 = trunc i64 %222 to i32
%224 = call i8* @malloc(i32 %223)
store i8* %224, i8** %13
%225 = load i8*, i8** %13
%226 = icmp ne i8* %225, null
br i1 %226, label %234, label %227
227: ; preds = %215
%228 = load i32, i32* @stderr
%229 = load i32, i32* %19
%230 = sext i32 %229 to i64
%231 = mul i64 %230, 1
%232 = trunc i64 %231 to i32
%233 = call i32 (i32, i8*, ...) @fprintf(i32 %228, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i32 %232)
store i32 10, i32* %10
br label %398
234: ; preds = %215
%235 = load i64, i64* %8
%236 = icmp ugt i64 %235, 0
br i1 %236, label %237, label %253
237: ; preds = %234
%238 = load i8*, i8** %14
%239 = call i32 @free(i8* %238)
%240 = load i64, i64* %8
%241 = mul i64 %240, 1
%242 = trunc i64 %241 to i32
%243 = call i8* @malloc(i32 %242)
store i8* %243, i8** %14
%244 = load i8*, i8** %14
%245 = icmp ne i8* %244, null
br i1 %245, label %252, label %246
246: ; preds = %237
%247 = load i32, i32* @stderr
%248 = load i64, i64* %8
%249 = mul i64 %248, 1
%250 = trunc i64 %249 to i32
%251 = call i32 (i32, i8*, ...) @fprintf(i32 %247, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i32 %250)
store i32 10, i32* %10
br label %398
252: ; preds = %237
br label %253
253: ; preds = %252, %234
store i32 0, i32* %20
%254 = load i64, i64* %15
%255 = icmp ne i64 %254, 0
br i1 %255, label %256, label %258
256: ; preds = %253
%257 = load i64, i64* %15
br label %259
258: ; preds = %253
br label %259
259: ; preds = %258, %256
%260 = phi i64 [ %257, %256 ], [ 65536, %258 ]
store i64 %260, i64* %21
%261 = load i64, i64* %21
%262 = trunc i64 %261 to i32
%263 = call i8* @malloc(i32 %262)
store i8* %263, i8** %16
%264 = load i64, i64* %21
%265 = trunc i64 %264 to i32
%266 = call i8* @malloc(i32 %265)
store i8* %266, i8** %17
%267 = load i8*, i8** %16
%268 = icmp ne i8* %267, null
br i1 %268, label %269, label %274
269: ; preds = %259
%270 = load i32*, i32** %6
%271 = load i8*, i8** %16
%272 = load i64, i64* %21
%273 = call i32 @setbuffer(i32* %270, i8* %271, i64 %272)
br label %274
274: ; preds = %269, %259
%275 = load i8*, i8** %17
%276 = icmp ne i8* %275, null
br i1 %276, label %277, label %282
277: ; preds = %274
%278 = load i32*, i32** %7
%279 = load i8*, i8** %17
%280 = load i64, i64* %21
%281 = call i32 @setbuffer(i32* %278, i8* %279, i64 %280)
br label %282
282: ; preds = %277, %274
br label %283
283: ; preds = %396, %282
%284 = load i32, i32* %10
%285 = icmp ne i32 %284, 0
br i1 %285, label %291, label %286
286: ; preds = %283
%287 = load i32*, i32** %6
%288 = call i32 @feof(i32* %287)
%289 = icmp ne i32 %288, 0
%290 = xor i1 %289, true
br label %291
291: ; preds = %286, %283
%292 = phi i1 [ false, %283 ], [ %290, %286 ]
br i1 %292, label %293, label %397
293: ; preds = %291
%294 = load i8*, i8** %13
%295 = load i32, i32* %19
%296 = load i32*, i32** %6
%297 = call i8* @fgets(i8* %294, i32 %295, i32* %296)
store i8* %297, i8** %22
%298 = load i8*, i8** %22
%299 = icmp ne i8* %298, null
br i1 %299, label %300, label %396
300: ; preds = %293
%301 = load i32, i32* %20
%302 = add nsw i32 %301, 1
store i32 %302, i32* %20
%303 = load i64, i64* %8
%304 = icmp ne i64 %303, 0
br i1 %304, label %342, label %305
305: ; preds = %300
%306 = load i8*, i8** %13
%307 = call i32 @hashLen(i8* %306)
store i32 %307, i32* %23
%308 = load i32, i32* %23
%309 = icmp sle i32 %308, 0
br i1 %309, label %314, label %310
310: ; preds = %305
%311 = load i32, i32* %23
%312 = and i32 %311, 1
%313 = icmp ne i32 %312, 0
br i1 %313, label %314, label %318
314: ; preds = %310, %305
%315 = load i32, i32* @stderr
%316 = load i32, i32* %23
%317 = call i32 (i32, i8*, ...) @fprintf(i32 %315, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.14, i64 0, i64 0), i32 %316)
store i32 10, i32* %10
br label %397
318: ; preds = %310
%319 = load i32, i32* %23
%320 = sdiv i32 %319, 2
%321 = sext i32 %320 to i64
store i64 %321, i64* %8
%322 = load i32, i32* @stderr
%323 = load i64, i64* %8
%324 = trunc i64 %323 to i32
%325 = load i32, i32* %23
%326 = call i32 (i32, i8*, ...) @fprintf(i32 %322, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.15, i64 0, i64 0), i32 %324, i32 %325)
%327 = load i8*, i8** %14
%328 = call i32 @free(i8* %327)
%329 = load i64, i64* %8
%330 = mul i64 %329, 1
%331 = trunc i64 %330 to i32
%332 = call i8* @malloc(i32 %331)
store i8* %332, i8** %14
%333 = load i8*, i8** %14
%334 = icmp ne i8* %333, null
br i1 %334, label %341, label %335
335: ; preds = %318
%336 = load i32, i32* @stderr
%337 = load i64, i64* %8
%338 = mul i64 %337, 1
%339 = trunc i64 %338 to i32
%340 = call i32 (i32, i8*, ...) @fprintf(i32 %336, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i32 %339)
store i32 10, i32* %10
br label %397
341: ; preds = %318
br label %342
342: ; preds = %341, %300
%343 = load i8*, i8** %13
%344 = load i64, i64* %8
%345 = load i8*, i8** %14
%346 = call i32 @convertHash(i8* %343, i64 %344, i8* %345)
store i32 %346, i32* %24
%347 = load i32, i32* %24
%348 = icmp ne i32 %347, 0
br i1 %348, label %350, label %349
349: ; preds = %342
br label %395
350: ; preds = %342
%351 = load i32, i32* %24
%352 = icmp slt i32 %351, 0
br i1 %352, label %358, label %353
353: ; preds = %350
%354 = load i32, i32* %24
%355 = sext i32 %354 to i64
%356 = load i64, i64* %8
%357 = icmp ne i64 %355, %356
br i1 %357, label %358, label %366
358: ; preds = %353, %350
%359 = load i32, i32* @stderr
%360 = load i32, i32* %24
%361 = load i32, i32* %20
%362 = load i64, i64* %8
%363 = trunc i64 %362 to i32
%364 = load i8*, i8** %13
%365 = call i32 (i32, i8*, ...) @fprintf(i32 %359, i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.16, i64 0, i64 0), i32 %360, i32 %361, i32 %363, i8* %364)
br label %394
366: ; preds = %353
%367 = load i8*, i8** %14
%368 = load i64, i64* %8
%369 = load i32*, i32** %7
%370 = call i64 @fwrite(i8* %367, i64 %368, i32 1, i32* %369)
store i64 %370, i64* %25
%371 = load i64, i64* %25
%372 = icmp ne i64 %371, 1
br i1 %372, label %373, label %391
373: ; preds = %366
%374 = load i32*, i32** %7
%375 = call i32 @ferror(i32* %374)
store i32 %375, i32* %26
%376 = load i32, i32* %26
%377 = icmp ne i32 %376, 0
br i1 %377, label %378, label %385
378: ; preds = %373
%379 = load i32, i32* @stderr
%380 = load i32, i32* %26
%381 = load i32, i32* %20
%382 = load i32, i32* %26
%383 = call i8* @strerror(i32 %382)
%384 = call i32 (i32, i8*, ...) @fprintf(i32 %379, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.17, i64 0, i64 0), i32 %380, i32 %381, i8* %383)
br label %390
385: ; preds = %373
%386 = load i32, i32* @stderr
%387 = load i32, i32* %26
%388 = load i32, i32* %20
%389 = call i32 (i32, i8*, ...) @fprintf(i32 %386, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.18, i64 0, i64 0), i32 %387, i32 %388)
br label %390
390: ; preds = %385, %378
store i32 10, i32* %10
br label %397
391: ; preds = %366
%392 = load i32, i32* %12
%393 = add i32 %392, 1
store i32 %393, i32* %12
br label %394
394: ; preds = %391, %358
br label %395
395: ; preds = %394, %349
br label %396
396: ; preds = %395, %293
br label %283
397: ; preds = %390, %335, %314, %291
br label %398
398: ; preds = %397, %246, %227, %205, %201
%399 = load i8*, i8** %13
%400 = call i32 @free(i8* %399)
%401 = load i8*, i8** %14
%402 = call i32 @free(i8* %401)
%403 = load i32, i32* %12
%404 = icmp ne i32 %403, 0
br i1 %404, label %405, label %409
405: ; preds = %398
%406 = load i32, i32* @stderr
%407 = load i32, i32* %12
%408 = call i32 (i32, i8*, ...) @fprintf(i32 %406, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.19, i64 0, i64 0), i32 %407)
br label %409
409: ; preds = %405, %398
%410 = load i32*, i32** %7
%411 = load i32*, i32** @stdout
%412 = icmp ne i32* %410, %411
br i1 %412, label %413, label %418
413: ; preds = %409
%414 = load i32*, i32** %7
%415 = call i32 @fclose(i32* %414)
%416 = load i8*, i8** %17
%417 = call i32 @free(i8* %416)
br label %418
418: ; preds = %413, %409
%419 = load i32*, i32** %6
%420 = load i32*, i32** @stdin
%421 = icmp ne i32* %419, %420
br i1 %421, label %422, label %427
422: ; preds = %418
%423 = load i32*, i32** %6
%424 = call i32 @fclose(i32* %423)
%425 = load i8*, i8** %16
%426 = call i32 @free(i8* %425)
br label %427
427: ; preds = %422, %418
%428 = load i32, i32* %10
ret i32 %428
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32* null
@.str = [3 x i8] c"-n\00"
@stderr = global i32 0
@.str.1 = [54 x i8] c"error: rawSize (value for '-n' = '%s') must be > 0 !\0A\00"
@.str.2 = [3 x i8] c"-B\00"
@.str.3 = [3 x i8] c"-i\00"
@.str.4 = [2 x i8] c"r\00"
@.str.5 = [45 x i8] c"error: input file '%s' could not be opened!\0A\00"
@.str.6 = [3 x i8] c"-o\00"
@.str.7 = [3 x i8] c"wb\00"
@.str.8 = [46 x i8] c"error: output file '%s' could not be opened!\0A\00"
@.str.9 = [3 x i8] c"-h\00"
@.str.10 = [7 x i8] c"--help\00"
@.str.11 = [30 x i8] c"error: ignoring option '%s'!\0A\00"
@.str.12 = [43 x i8] c"error allocating line buffer of %u bytes!\0A\00"
@.str.13 = [45 x i8] c"error allocating binary buffer of %u bytes!\0A\00"
@.str.14 = [59 x i8] c"error: hexadecimal length of 1st line (=%d) must be even!\0A\00"
@.str.15 = [53 x i8] c"info: using rawSize %d from 1st line with hexLen %d\0A\00"
@.str.16 = [99 x i8] c"warning: hexadecimal length %d of line %d does not match expected value of %d! skipping line '%s'\0A\00"
@.str.17 = [52 x i8] c"error %d writing binary for line %d to output!: %s\0A\00"
@.str.18 = [48 x i8] c"error %d writing binary for line %d to output!\0A\00"
@.str.19 = [46 x i8] c"successfully converted %u hexadecimal lines.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32*, i32** @stdin
%4 = load i32*, i32** @stdout
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %100
6: ; preds = %2, %87
%7 = phi i32* [ %93, %87 ], [ %3, %2 ]
%8 = phi i32* [ %92, %87 ], [ %4, %2 ]
%9 = phi i64 [ %91, %87 ], [ 0, %2 ]
%10 = phi i32 [ %90, %87 ], [ 0, %2 ]
%11 = phi i32 [ %94, %87 ], [ 1, %2 ]
%12 = phi i64 [ %88, %87 ], [ 0, %2 ]
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %32
18: ; preds = %6
%19 = add nsw i32 %11, 1
%20 = icmp slt i32 %19, %0
br i1 %20, label %21, label %32
21: ; preds = %18
%22 = sext i32 %19 to i64
%23 = getelementptr inbounds i8*, i8** %1, i64 %22
%24 = load i8*, i8** %23
%25 = tail call i32 @atoi(i8* %24)
%26 = icmp slt i32 %25, 1
br i1 %26, label %29, label %27
27: ; preds = %21
%28 = zext i32 %25 to i64
br label %87
29: ; preds = %21
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i8* %24)
br label %207
32: ; preds = %18, %6
%33 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %44
35: ; preds = %32
%36 = add nsw i32 %11, 1
%37 = icmp slt i32 %36, %0
br i1 %37, label %38, label %44
38: ; preds = %35
%39 = sext i32 %36 to i64
%40 = getelementptr inbounds i8*, i8** %1, i64 %39
%41 = load i8*, i8** %40
%42 = tail call i64 @atol(i8* %41)
%43 = shl nsw i64 %42, 10
br label %87
44: ; preds = %35, %32
%45 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %61
47: ; preds = %44
%48 = add nsw i32 %11, 1
%49 = icmp slt i32 %48, %0
br i1 %49, label %50, label %61
50: ; preds = %47
%51 = sext i32 %48 to i64
%52 = getelementptr inbounds i8*, i8** %1, i64 %51
%53 = load i8*, i8** %52
%54 = tail call i32* @fopen(i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%55 = icmp eq i32* %54, null
br i1 %55, label %56, label %87
56: ; preds = %50
%57 = getelementptr inbounds i8*, i8** %1, i64 %51
%58 = load i32, i32* @stderr
%59 = load i8*, i8** %57
%60 = tail call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0), i8* %59)
br label %207
61: ; preds = %47, %44
%62 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %78
64: ; preds = %61
%65 = add nsw i32 %11, 1
%66 = icmp slt i32 %65, %0
br i1 %66, label %67, label %78
67: ; preds = %64
%68 = sext i32 %65 to i64
%69 = getelementptr inbounds i8*, i8** %1, i64 %68
%70 = load i8*, i8** %69
%71 = tail call i32* @fopen(i8* %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%72 = icmp eq i32* %71, null
br i1 %72, label %73, label %87
73: ; preds = %67
%74 = getelementptr inbounds i8*, i8** %1, i64 %68
%75 = load i32, i32* @stderr
%76 = load i8*, i8** %74
%77 = tail call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i8* %76)
br label %207
78: ; preds = %64, %61
%79 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%80 = icmp eq i32 %79, 0
br i1 %80, label %87, label %81
81: ; preds = %78
%82 = tail call i32 @strcmp(i8* dereferenceable(1) %15, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%83 = icmp eq i32 %82, 0
br i1 %83, label %87, label %84
84: ; preds = %81
%85 = load i32, i32* @stderr
%86 = tail call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i8* %15)
br label %87
87: ; preds = %27, %78, %81, %67, %50, %84, %38
%88 = phi i64 [ %12, %84 ], [ %43, %38 ], [ %12, %50 ], [ %12, %67 ], [ %12, %81 ], [ %12, %78 ], [ %12, %27 ]
%89 = phi i32 [ %11, %84 ], [ %36, %38 ], [ %48, %50 ], [ %65, %67 ], [ %11, %81 ], [ %11, %78 ], [ %19, %27 ]
%90 = phi i32 [ 1, %84 ], [ %10, %38 ], [ %10, %50 ], [ %10, %67 ], [ 1, %81 ], [ 1, %78 ], [ %10, %27 ]
%91 = phi i64 [ %9, %84 ], [ %9, %38 ], [ %9, %50 ], [ %9, %67 ], [ %9, %81 ], [ %9, %78 ], [ %28, %27 ]
%92 = phi i32* [ %8, %84 ], [ %8, %38 ], [ %8, %50 ], [ %71, %67 ], [ %8, %81 ], [ %8, %78 ], [ %8, %27 ]
%93 = phi i32* [ %7, %84 ], [ %7, %38 ], [ %54, %50 ], [ %7, %67 ], [ %7, %81 ], [ %7, %78 ], [ %7, %27 ]
%94 = add nsw i32 %89, 1
%95 = icmp slt i32 %94, %0
br i1 %95, label %6, label %96
96: ; preds = %87
%97 = icmp eq i32 %90, 0
br i1 %97, label %100, label %98
98: ; preds = %96
%99 = tail call i32 (...) @usage()
br label %207
100: ; preds = %2, %96
%101 = phi i32* [ %93, %96 ], [ %3, %2 ]
%102 = phi i32* [ %92, %96 ], [ %4, %2 ]
%103 = phi i64 [ %91, %96 ], [ 0, %2 ]
%104 = phi i64 [ %88, %96 ], [ 0, %2 ]
%105 = icmp eq i64 %103, 0
%106 = trunc i64 %103 to i32
%107 = mul i32 %106, 3
%108 = add i32 %107, 16
%109 = select i1 %105, i32 1024, i32 %108
%110 = tail call i32 @free(i8* null)
%111 = tail call i8* @malloc(i32 %109)
%112 = icmp eq i8* %111, null
br i1 %112, label %113, label %116
113: ; preds = %100
%114 = load i32, i32* @stderr
%115 = tail call i32 (i32, i8*, ...) @fprintf(i32 %114, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i32 %109)
br label %207
116: ; preds = %100
br i1 %105, label %124, label %117
117: ; preds = %116
%118 = tail call i32 @free(i8* null)
%119 = tail call i8* @malloc(i32 %106)
%120 = icmp eq i8* %119, null
br i1 %120, label %121, label %124
121: ; preds = %117
%122 = load i32, i32* @stderr
%123 = tail call i32 (i32, i8*, ...) @fprintf(i32 %122, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i32 %106)
br label %207
124: ; preds = %117, %116
%125 = phi i8* [ %119, %117 ], [ null, %116 ]
%126 = icmp eq i64 %104, 0
%127 = select i1 %126, i64 65536, i64 %104
%128 = trunc i64 %127 to i32
%129 = tail call i8* @malloc(i32 %128)
%130 = tail call i8* @malloc(i32 %128)
%131 = icmp eq i8* %129, null
br i1 %131, label %134, label %132
132: ; preds = %124
%133 = tail call i32 @setbuffer(i32* %101, i8* %129, i64 %127)
br label %134
134: ; preds = %132, %124
%135 = icmp eq i8* %130, null
br i1 %135, label %138, label %136
136: ; preds = %134
%137 = tail call i32 @setbuffer(i32* %102, i8* %130, i64 %127)
br label %138
138: ; preds = %136, %134
%139 = tail call i32 @feof(i32* %101)
%140 = icmp eq i32 %139, 0
br i1 %140, label %141, label %207
141: ; preds = %138, %200
%142 = phi i64 [ %204, %200 ], [ %103, %138 ]
%143 = phi i32 [ %203, %200 ], [ 0, %138 ]
%144 = phi i32 [ %202, %200 ], [ 0, %138 ]
%145 = phi i8* [ %201, %200 ], [ %125, %138 ]
%146 = tail call i8* @fgets(i8* %111, i32 %109, i32* %101)
%147 = icmp eq i8* %146, null
br i1 %147, label %200, label %148
148: ; preds = %141
%149 = add nsw i32 %143, 1
%150 = icmp eq i64 %142, 0
br i1 %150, label %151, label %172
151: ; preds = %148
%152 = tail call i32 @hashLen(i8* %111)
%153 = icmp sgt i32 %152, 0
%154 = and i32 %152, 1
%155 = icmp eq i32 %154, 0
%156 = and i1 %153, %155
br i1 %156, label %160, label %157
157: ; preds = %151
%158 = load i32, i32* @stderr
%159 = tail call i32 (i32, i8*, ...) @fprintf(i32 %158, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.14, i64 0, i64 0), i32 %152)
br label %207
160: ; preds = %151
%161 = lshr i32 %152, 1
%162 = load i32, i32* @stderr
%163 = tail call i32 (i32, i8*, ...) @fprintf(i32 %162, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.15, i64 0, i64 0), i32 %161, i32 %152)
%164 = tail call i32 @free(i8* %145)
%165 = tail call i8* @malloc(i32 %161)
%166 = icmp eq i8* %165, null
br i1 %166, label %167, label %170
167: ; preds = %160
%168 = load i32, i32* @stderr
%169 = tail call i32 (i32, i8*, ...) @fprintf(i32 %168, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), i32 %161)
br label %207
170: ; preds = %160
%171 = zext i32 %161 to i64
br label %172
172: ; preds = %170, %148
%173 = phi i8* [ %145, %148 ], [ %165, %170 ]
%174 = phi i64 [ %142, %148 ], [ %171, %170 ]
%175 = tail call i32 @convertHash(i8* %111, i64 %174, i8* %173)
%176 = icmp eq i32 %175, 0
br i1 %176, label %200, label %177
177: ; preds = %172
%178 = icmp sgt i32 %175, -1
%179 = sext i32 %175 to i64
%180 = icmp eq i64 %174, %179
%181 = and i1 %178, %180
br i1 %181, label %186, label %182
182: ; preds = %177
%183 = load i32, i32* @stderr
%184 = trunc i64 %174 to i32
%185 = tail call i32 (i32, i8*, ...) @fprintf(i32 %183, i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.16, i64 0, i64 0), i32 %175, i32 %149, i32 %184, i8* %111)
br label %200
186: ; preds = %177
%187 = tail call i64 @fwrite(i8* %173, i64 %174, i32 1, i32* %102)
%188 = icmp eq i64 %187, 1
br i1 %188, label %198, label %189
189: ; preds = %186
%190 = tail call i32 @ferror(i32* %102)
%191 = icmp eq i32 %190, 0
%192 = load i32, i32* @stderr
br i1 %191, label %196, label %193
193: ; preds = %189
%194 = tail call i8* @strerror(i32 %190)
%195 = tail call i32 (i32, i8*, ...) @fprintf(i32 %192, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.17, i64 0, i64 0), i32 %190, i32 %149, i8* %194)
br label %207
196: ; preds = %189
%197 = tail call i32 (i32, i8*, ...) @fprintf(i32 %192, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.18, i64 0, i64 0), i32 0, i32 %149)
br label %207
198: ; preds = %186
%199 = add i32 %144, 1
br label %200
200: ; preds = %172, %182, %198, %141
%201 = phi i8* [ %145, %141 ], [ %173, %198 ], [ %173, %182 ], [ %173, %172 ]
%202 = phi i32 [ %144, %141 ], [ %199, %198 ], [ %144, %182 ], [ %144, %172 ]
%203 = phi i32 [ %143, %141 ], [ %149, %198 ], [ %149, %182 ], [ %149, %172 ]
%204 = phi i64 [ %142, %141 ], [ %174, %198 ], [ %174, %182 ], [ %174, %172 ]
%205 = tail call i32 @feof(i32* %101)
%206 = icmp eq i32 %205, 0
br i1 %206, label %141, label %207
207: ; preds = %200, %138, %167, %157, %196, %193, %29, %56, %73, %113, %121, %98
%208 = phi i32* [ %93, %98 ], [ %101, %121 ], [ %101, %113 ], [ %7, %29 ], [ null, %56 ], [ %7, %73 ], [ %101, %193 ], [ %101, %196 ], [ %101, %157 ], [ %101, %167 ], [ %101, %138 ], [ %101, %200 ]
%209 = phi i32* [ %92, %98 ], [ %102, %121 ], [ %102, %113 ], [ %8, %29 ], [ %8, %56 ], [ null, %73 ], [ %102, %193 ], [ %102, %196 ], [ %102, %157 ], [ %102, %167 ], [ %102, %138 ], [ %102, %200 ]
%210 = phi i8* [ null, %98 ], [ %111, %121 ], [ null, %113 ], [ null, %29 ], [ null, %56 ], [ null, %73 ], [ %111, %193 ], [ %111, %196 ], [ %111, %157 ], [ %111, %167 ], [ %111, %138 ], [ %111, %200 ]
%211 = phi i8* [ null, %98 ], [ null, %121 ], [ null, %113 ], [ null, %29 ], [ null, %56 ], [ null, %73 ], [ %173, %193 ], [ %173, %196 ], [ %145, %157 ], [ null, %167 ], [ %125, %138 ], [ %201, %200 ]
%212 = phi i8* [ null, %98 ], [ null, %121 ], [ null, %113 ], [ null, %29 ], [ null, %56 ], [ null, %73 ], [ %129, %193 ], [ %129, %196 ], [ %129, %157 ], [ %129, %167 ], [ %129, %138 ], [ %129, %200 ]
%213 = phi i8* [ null, %98 ], [ null, %121 ], [ null, %113 ], [ null, %29 ], [ null, %56 ], [ null, %73 ], [ %130, %193 ], [ %130, %196 ], [ %130, %157 ], [ %130, %167 ], [ %130, %138 ], [ %130, %200 ]
%214 = phi i32 [ 0, %98 ], [ 0, %121 ], [ 0, %113 ], [ 0, %29 ], [ 0, %56 ], [ 0, %73 ], [ %144, %193 ], [ %144, %196 ], [ %144, %157 ], [ %144, %167 ], [ 0, %138 ], [ %202, %200 ]
%215 = phi i32 [ 1, %98 ], [ 10, %121 ], [ 10, %113 ], [ 10, %29 ], [ 10, %56 ], [ 10, %73 ], [ 10, %193 ], [ 10, %196 ], [ 10, %157 ], [ 10, %167 ], [ 0, %138 ], [ 0, %200 ]
%216 = tail call i32 @free(i8* %210)
%217 = tail call i32 @free(i8* %211)
%218 = icmp eq i32 %214, 0
br i1 %218, label %222, label %219
219: ; preds = %207
%220 = load i32, i32* @stderr
%221 = tail call i32 (i32, i8*, ...) @fprintf(i32 %220, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.19, i64 0, i64 0), i32 %214)
br label %222
222: ; preds = %219, %207
%223 = load i32*, i32** @stdout
%224 = icmp eq i32* %209, %223
br i1 %224, label %228, label %225
225: ; preds = %222
%226 = tail call i32 @fclose(i32* %209)
%227 = tail call i32 @free(i8* %213)
br label %228
228: ; preds = %225, %222
%229 = load i32*, i32** @stdin
%230 = icmp eq i32* %208, %229
br i1 %230, label %234, label %231
231: ; preds = %228
%232 = tail call i32 @fclose(i32* %208)
%233 = tail call i32 @free(i8* %212)
br label %234
234: ; preds = %231, %228
ret i32 %215
}