#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
int /*<<< orphan*/ munmap(char *, size_t);
int num_lines(char *, int *);
int rs_mmap(char *, char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stderr;
int xcat(char *, char *, size_t, size_t *);
int /*<<< orphan*/ zero_string(char *, int);
int /*<<< orphan*/ zero_string_to_nullc(char *);
int csv_to_json(char *infile, char **ptr_Y, size_t *ptr_nY) {
  int status = 0;
  char *Y = NULL;
  size_t nY = 0;
  char *X = NULL;
  size_t nX = 0;
  size_t lnX = 0;
  size_t n0 = 1024, i0 = 0;
  char buf0[n0];
  size_t n1 = 1024, i1 = 0;
  char buf1[n1];
  int nR = 0;
  *ptr_Y = NULL;
  *ptr_nY = 0;
  status = rs_mmap(infile, &X, &nX, 0);
  {
    if ((status) < 0) {
      {
        {
          fprintf(stderr, "Line %3d of File %s \n", 742,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/"
                  "heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
        };
        status = (status);
        goto BYE;
      }
    }
  };
  if (X == NULL) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 743,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/"
                "master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
      };
      status = -1;
      goto BYE;
    };
  }
  if (nX == 0) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 744,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/"
                "master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
      };
      status = -1;
      goto BYE;
    };
  }
  status = num_lines(infile, &nR);
  {
    if ((status) < 0) {
      {
        {
          fprintf(stderr, "Line %3d of File %s \n", 745,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/"
                  "heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
        };
        status = (status);
        goto BYE;
      }
    }
  };
  if (nR < 1) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 746,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/"
                "master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
      };
      status = -1;
      goto BYE;
    };
  }
  nY = 999999;
  Y = malloc(nY * sizeof(char));
  {
    if (Y == NULL) {
      fprintf(stderr, "Unable to allocate memory\n");
      {
        {
          fprintf(stderr, "Line %3d of File %s \n", 750,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/"
                  "heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
        };
        status = -1;
        goto BYE;
      };
    }
  };
  size_t iY = 0;
  status = xcat("{\n", Y, nY, &iY);
  {
    if ((status) < 0) {
      {
        {
          fprintf(stderr, "Line %3d of File %s \n", 752,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/"
                  "heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
        };
        status = (status);
        goto BYE;
      }
    }
  };
  int nC = 1;
  char *cptr = X;
  for (int i = 0; ((i < nX) && (*cptr != '\n')); i++, cptr++) {
    if (*cptr == ',') {
      nC++;
    }
  }
  zero_string(buf0, 1024);
  zero_string(buf1, 1024);
  int col_idx = 0;
  int row_idx = 0;
  for (row_idx = 0; row_idx < nR; row_idx++) {
    sprintf(buf1, "    \"r%d\": {\n", row_idx);
    status = xcat(buf1, Y, nY, &iY);
    {
      if ((status) < 0) {
        {
          {
            fprintf(stderr, "Line %3d of File %s \n", 768,
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/"
                    "heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
          };
          status = (status);
          goto BYE;
        }
      }
    };
    for (col_idx = 0; col_idx < nC; col_idx++) {
      sprintf(buf1, "        \"c%d\": \"", col_idx);
      xcat(buf1, buf0, n0, &i0);
      {
        if ((status) < 0) {
          {
            {
              fprintf(
                  stderr, "Line %3d of File %s \n", 771,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/"
                  "heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
            };
            status = (status);
            goto BYE;
          }
        }
      };
      char *cptr = X + lnX;
      for (; ((*cptr != '\n') && (*cptr != ',')); cptr++) {
        buf0[i0++] = X[lnX++];
      }
      buf0[i0++] = '\"';
      if (col_idx < (nC - 1)) {
        buf0[i0++] = ',';
      }
      buf0[i0++] = '\n';
      status = xcat(buf0, Y, nY, &iY);
      {
        if ((status) < 0) {
          {
            {
              fprintf(
                  stderr, "Line %3d of File %s \n", 779,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/"
                  "heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
            };
            status = (status);
            goto BYE;
          }
        }
      };
      lnX++;
      if (lnX == nX) {
        break;
      }
      zero_string_to_nullc(buf1);
      i1 = 0;
      zero_string_to_nullc(buf0);
      i0 = 0;
    }
    if (row_idx < (nR - 1)) {
      status = xcat("    },\n", Y, nY, &iY);
      {
        if ((status) < 0) {
          {
            {
              fprintf(
                  stderr, "Line %3d of File %s \n", 786,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/"
                  "heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
            };
            status = (status);
            goto BYE;
          }
        }
      };
    } else {
      status = xcat("    }\n", Y, nY, &iY);
      {
        if ((status) < 0) {
          {
            {
              fprintf(
                  stderr, "Line %3d of File %s \n", 789,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/"
                  "heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
            };
            status = (status);
            goto BYE;
          }
        }
      };
    }
  }
  status = xcat("}\n", Y, nY, &iY);
  {
    if ((status) < 0) {
      {
        {
          fprintf(stderr, "Line %3d of File %s \n", 792,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/"
                  "heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
        };
        status = (status);
        goto BYE;
      }
    }
  };
  if (lnX != nX) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 793,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/"
                "master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
      };
      status = -1;
      goto BYE;
    };
  }
  Y[iY++] = '\0';
  *ptr_Y = malloc(iY * sizeof(char));
  {
    if (*ptr_Y == NULL) {
      fprintf(stderr, "Unable to allocate memory\n");
      {
        {
          fprintf(stderr, "Line %3d of File %s \n", 797,
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/"
                  "heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
        };
        status = -1;
        goto BYE;
      };
    }
  };
  memcpy(*ptr_Y, Y, iY);
  *ptr_nY = iY;
BYE : {
  if ((Y) != NULL) {
    free((Y));
    (Y) = NULL;
  }
};
  {
    if ((X == NULL) && (nX != 0)) {
      {
        fprintf(stderr, "Line %3d of File %s \n", 802,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/"
                "master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
      };
      return (-1);
    }
    if ((X != NULL) && (nX == 0)) {
      {
        fprintf(stderr, "Line %3d of File %s \n", 802,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/"
                "master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
      };
      return (-1);
    }
    if (X != NULL) {
      munmap(X, nX);
      X = NULL;
      nX = 0;
    }
  };
  return status;
}


x86 assembly (clang, -O0):
<csv_to_json>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x400,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
mov    -0x58(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xd8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x70(%rbp)
movq   $0x400,-0x78(%rbp)
movq   $0x0,-0x80(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xd0(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x88(%rbp)
movl   $0x0,-0x8c(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x48(%rbp),%rdx
xor    %ecx,%ecx
call   10a0 <rs_mmap@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    12d4 <csv_to_json+0x124>
mov    0x2d33(%rip),%rax
mov    (%rax),%edi
lea    0xd4a(%rip),%rsi
mov    $0x2e6,%edx
lea    0xd54(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
cmpq   $0x0,-0x40(%rbp)
jne    130e <csv_to_json+0x15e>
mov    0x2cfa(%rip),%rax
mov    (%rax),%edi
lea    0xd11(%rip),%rsi
mov    $0x2e7,%edx
lea    0xd1b(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
cmpq   $0x0,-0x48(%rbp)
jne    1348 <csv_to_json+0x198>
mov    0x2cc0(%rip),%rax
mov    (%rax),%edi
lea    0xcd7(%rip),%rsi
mov    $0x2e8,%edx
lea    0xce1(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
mov    -0x10(%rbp),%rdi
lea    -0x8c(%rbp),%rsi
call   1050 <num_lines@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1393 <csv_to_json+0x1e3>
mov    0x2c74(%rip),%rax
mov    (%rax),%edi
lea    0xc8b(%rip),%rsi
mov    $0x2e9,%edx
lea    0xc95(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
cmpl   $0x1,-0x8c(%rbp)
jge    13cf <csv_to_json+0x21f>
mov    0x2c39(%rip),%rax
mov    (%rax),%edi
lea    0xc50(%rip),%rsi
mov    $0x2ea,%edx
lea    0xc5a(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
movq   $0xf423f,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
shl    $0x0,%rdi
call   1090 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1439 <csv_to_json+0x289>
mov    0x2be6(%rip),%rax
mov    (%rax),%edi
lea    0xcba(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2bcf(%rip),%rax
mov    (%rax),%edi
lea    0xbe6(%rip),%rsi
mov    $0x2ee,%edx
lea    0xbf0(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
movq   $0x0,-0x98(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
lea    0xc90(%rip),%rdi
lea    -0x98(%rbp),%rcx
call   10c0 <xcat@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    149a <csv_to_json+0x2ea>
mov    0x2b6d(%rip),%rax
mov    (%rax),%edi
lea    0xb84(%rip),%rsi
mov    $0x2f0,%edx
lea    0xb8e(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
movl   $0x1,-0x9c(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0xa8(%rbp)
movl   $0x0,-0xac(%rbp)
movslq -0xac(%rbp),%rcx
xor    %eax,%eax
cmp    -0x48(%rbp),%rcx
mov    %al,-0xd9(%rbp)
jae    14e8 <csv_to_json+0x338>
mov    -0xa8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0xd9(%rbp)
mov    -0xd9(%rbp),%al
test   $0x1,%al
jne    14fb <csv_to_json+0x34b>
jmp    1548 <csv_to_json+0x398>
mov    -0xa8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    151d <csv_to_json+0x36d>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1522 <csv_to_json+0x372>
mov    -0xac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xac(%rbp)
mov    -0xa8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa8(%rbp)
jmp    14b9 <csv_to_json+0x309>
mov    -0xd8(%rbp),%rdi
mov    $0x400,%esi
call   1060 <zero_string@plt>
mov    -0xd0(%rbp),%rdi
mov    $0x400,%esi
call   1060 <zero_string@plt>
movl   $0x0,-0xb0(%rbp)
movl   $0x0,-0xb4(%rbp)
movl   $0x0,-0xb4(%rbp)
mov    -0xb4(%rbp),%eax
cmp    -0x8c(%rbp),%eax
jge    191f <csv_to_json+0x76f>
mov    -0xd0(%rbp),%rdi
mov    -0xb4(%rbp),%edx
lea    0xb2a(%rip),%rsi
call   10d0 <sprintf@plt>
mov    -0xd0(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
lea    -0x98(%rbp),%rcx
call   10c0 <xcat@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1609 <csv_to_json+0x459>
mov    0x29fe(%rip),%rax
mov    (%rax),%edi
lea    0xa15(%rip),%rsi
mov    $0x300,%edx
lea    0xa1f(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
movl   $0x0,-0xb0(%rbp)
mov    -0xb0(%rbp),%eax
cmp    -0x9c(%rbp),%eax
jge    1839 <csv_to_json+0x689>
mov    -0xd0(%rbp),%rdi
mov    -0xb0(%rbp),%edx
lea    0xaad(%rip),%rsi
call   10d0 <sprintf@plt>
mov    -0xd0(%rbp),%rdi
mov    -0xd8(%rbp),%rsi
mov    -0x58(%rbp),%rdx
lea    -0x60(%rbp),%rcx
call   10c0 <xcat@plt>
cmpl   $0x0,-0x24(%rbp)
jge    1691 <csv_to_json+0x4e1>
mov    0x2976(%rip),%rax
mov    (%rax),%edi
lea    0x98d(%rip),%rsi
mov    $0x303,%edx
lea    0x997(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
mov    -0x40(%rbp),%rax
add    -0x50(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0xc0(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xda(%rbp)
je     16d1 <csv_to_json+0x521>
mov    -0xc0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
setne  %al
mov    %al,-0xda(%rbp)
mov    -0xda(%rbp),%al
test   $0x1,%al
jne    16e4 <csv_to_json+0x534>
jmp    172a <csv_to_json+0x57a>
mov    -0xd8(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    -0x50(%rbp),%rdx
mov    %rdx,%rsi
add    $0x1,%rsi
mov    %rsi,-0x50(%rbp)
mov    (%rcx,%rdx,1),%dl
mov    -0x60(%rbp),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,-0x60(%rbp)
mov    %dl,(%rax,%rcx,1)
mov    -0xc0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xc0(%rbp)
jmp    16a0 <csv_to_json+0x4f0>
mov    -0xd8(%rbp),%rax
mov    -0x60(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x60(%rbp)
movb   $0x22,(%rax,%rcx,1)
mov    -0xb0(%rbp),%eax
mov    -0x9c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1775 <csv_to_json+0x5c5>
mov    -0xd8(%rbp),%rax
mov    -0x60(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x60(%rbp)
movb   $0x2c,(%rax,%rcx,1)
mov    -0xd8(%rbp),%rdi
mov    -0x60(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x60(%rbp)
movb   $0xa,(%rdi,%rax,1)
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
lea    -0x98(%rbp),%rcx
call   10c0 <xcat@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    17de <csv_to_json+0x62e>
mov    0x2829(%rip),%rax
mov    (%rax),%edi
lea    0x840(%rip),%rsi
mov    $0x30b,%edx
lea    0x84a(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
cmp    -0x48(%rbp),%rax
jne    17fd <csv_to_json+0x64d>
jmp    1839 <csv_to_json+0x689>
mov    -0xd0(%rbp),%rdi
call   1030 <zero_string_to_nullc@plt>
mov    -0xd8(%rbp),%rdi
movq   $0x0,-0x80(%rbp)
call   1030 <zero_string_to_nullc@plt>
movq   $0x0,-0x60(%rbp)
mov    -0xb0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb0(%rbp)
jmp    1613 <csv_to_json+0x463>
mov    -0xb4(%rbp),%eax
mov    -0x8c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    18ab <csv_to_json+0x6fb>
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
lea    0x898(%rip),%rdi
lea    -0x98(%rbp),%rcx
call   10c0 <xcat@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    18a6 <csv_to_json+0x6f6>
mov    0x2761(%rip),%rax
mov    (%rax),%edi
lea    0x778(%rip),%rsi
mov    $0x312,%edx
lea    0x782(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
jmp    1906 <csv_to_json+0x756>
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
lea    0x845(%rip),%rdi
lea    -0x98(%rbp),%rcx
call   10c0 <xcat@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1901 <csv_to_json+0x751>
mov    0x2706(%rip),%rax
mov    (%rax),%edi
lea    0x71d(%rip),%rsi
mov    $0x315,%edx
lea    0x727(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
jmp    1906 <csv_to_json+0x756>
jmp    190b <csv_to_json+0x75b>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    1588 <csv_to_json+0x3d8>
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
lea    0x7d5(%rip),%rdi
lea    -0x98(%rbp),%rcx
call   10c0 <xcat@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1975 <csv_to_json+0x7c5>
mov    0x2692(%rip),%rax
mov    (%rax),%edi
lea    0x6a9(%rip),%rsi
mov    $0x318,%edx
lea    0x6b3(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
mov    -0x50(%rbp),%rax
cmp    -0x48(%rbp),%rax
je     19b2 <csv_to_json+0x802>
mov    0x2656(%rip),%rax
mov    (%rax),%edi
lea    0x66d(%rip),%rsi
mov    $0x319,%edx
lea    0x677(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
mov    -0x30(%rbp),%rax
mov    -0x98(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x98(%rbp)
movb   $0x0,(%rax,%rcx,1)
mov    -0x98(%rbp),%rdi
shl    $0x0,%rdi
call   1090 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1a3d <csv_to_json+0x88d>
mov    0x25e2(%rip),%rax
mov    (%rax),%edi
lea    0x6b6(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x25cb(%rip),%rax
mov    (%rax),%edi
lea    0x5e2(%rip),%rsi
mov    $0x31d,%edx
lea    0x5ec(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    1a62 <csv_to_json+0x8b2>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x98(%rbp),%rdx
call   1080 <memcpy@plt>
mov    -0x98(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x30(%rbp)
je     1a7e <csv_to_json+0x8ce>
mov    -0x30(%rbp),%rdi
call   1040 <free@plt>
movq   $0x0,-0x30(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1acd <csv_to_json+0x91d>
cmpq   $0x0,-0x48(%rbp)
je     1acd <csv_to_json+0x91d>
mov    0x2545(%rip),%rax
mov    (%rax),%edi
lea    0x55c(%rip),%rsi
mov    $0x322,%edx
lea    0x566(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0xc4(%rbp)
jmp    1b54 <csv_to_json+0x9a4>
cmpq   $0x0,-0x40(%rbp)
je     1b1c <csv_to_json+0x96c>
cmpq   $0x0,-0x48(%rbp)
jne    1b1c <csv_to_json+0x96c>
mov    0x24f6(%rip),%rax
mov    (%rax),%edi
lea    0x50d(%rip),%rsi
mov    $0x322,%edx
lea    0x517(%rip),%rcx
mov    $0x0,%al
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0xc4(%rbp)
jmp    1b54 <csv_to_json+0x9a4>
cmpq   $0x0,-0x40(%rbp)
je     1b44 <csv_to_json+0x994>
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   10b0 <munmap@plt>
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0xc4(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csv_to_json>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x858,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r12
movq   $0x0,0x30(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x28(%rsp)
movl   $0x0,0x4(%rsp)
movq   $0x0,(%rsi)
movq   $0x0,(%rdx)
lea    0x30(%rsp),%rsi
lea    0x18(%rsp),%rdx
xor    %ecx,%ecx
call   10a0 <rs_mmap@plt>
test   %eax,%eax
js     12b0 <csv_to_json+0x100>
cmpq   $0x0,0x30(%rsp)
je     130d <csv_to_json+0x15d>
cmpq   $0x0,0x18(%rsp)
je     132e <csv_to_json+0x17e>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <num_lines@plt>
test   %eax,%eax
js     134c <csv_to_json+0x19c>
cmpl   $0x0,0x4(%rsp)
jle    136f <csv_to_json+0x1bf>
mov    $0xf423f,%edi
call   1090 <malloc@plt>
test   %rax,%rax
je     138d <csv_to_json+0x1dd>
mov    %rax,%r13
movq   $0x0,0x10(%rsp)
lea    0xe6e(%rip),%rdi
lea    0x10(%rsp),%rcx
mov    $0xf423f,%edx
mov    %rax,%rsi
call   10c0 <xcat@plt>
test   %eax,%eax
js     1440 <csv_to_json+0x290>
mov    0x18(%rsp),%rax
test   %rax,%rax
je     1463 <csv_to_json+0x2b3>
mov    $0x1,%ecx
mov    %rcx,0x20(%rsp)
mov    0x30(%rsp),%rcx
xor    %edx,%edx
jmp    12fa <csv_to_json+0x14a>
mov    %eax,%ebp
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
lea    0xd3e(%rip),%rsi
lea    0xd4d(%rip),%rcx
mov    $0x2e6,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    13c5 <csv_to_json+0x215>
nopw   0x0(%rax,%rax,1)
mov    0x20(%rsp),%rsi
add    $0x1,%esi
mov    %rsi,0x20(%rsp)
add    $0x1,%rdx
cmp    %rdx,%rax
je     146d <csv_to_json+0x2bd>
movzbl (%rcx,%rdx,1),%ebx
cmp    $0x2c,%bl
je     12e0 <csv_to_json+0x130>
cmp    $0xa,%bl
jne    12ed <csv_to_json+0x13d>
jmp    146d <csv_to_json+0x2bd>
mov    0x2ccc(%rip),%rax
mov    (%rax),%edi
lea    0xce3(%rip),%rsi
lea    0xcf2(%rip),%rcx
mov    $0x2e7,%edx
jmp    13b9 <csv_to_json+0x209>
mov    0x2cab(%rip),%rax
mov    (%rax),%edi
lea    0xcc2(%rip),%rsi
lea    0xcd1(%rip),%rcx
mov    $0x2e8,%edx
jmp    13b9 <csv_to_json+0x209>
mov    %eax,%ebp
mov    0x2c8b(%rip),%rax
mov    (%rax),%edi
lea    0xca2(%rip),%rsi
lea    0xcb1(%rip),%rcx
mov    $0x2e9,%edx
jmp    12ce <csv_to_json+0x11e>
mov    0x2c6a(%rip),%rax
mov    (%rax),%edi
lea    0xc81(%rip),%rsi
lea    0xc90(%rip),%rcx
mov    $0x2ea,%edx
jmp    13b9 <csv_to_json+0x209>
mov    0x2c4c(%rip),%rbx
mov    (%rbx),%edi
lea    0xd20(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%rbx),%edi
lea    0xc53(%rip),%rsi
lea    0xc62(%rip),%rcx
mov    $0x2ee,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xffffffff,%ebp
mov    0x30(%rsp),%rdi
mov    0x18(%rsp),%rsi
test   %rdi,%rdi
jne    13d9 <csv_to_json+0x229>
test   %rsi,%rsi
jne    13e3 <csv_to_json+0x233>
test   %rdi,%rdi
je     1422 <csv_to_json+0x272>
test   %rsi,%rsi
jne    1422 <csv_to_json+0x272>
mov    0x2bf6(%rip),%rax
mov    (%rax),%edi
lea    0xc0d(%rip),%rsi
lea    0xc1c(%rip),%rcx
mov    $0x322,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xffffffff,%ebp
mov    %r12,%rsp
mov    %ebp,%eax
add    $0x858,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %rdi,%rdi
je     140b <csv_to_json+0x25b>
call   10b0 <munmap@plt>
movq   $0x0,0x30(%rsp)
movq   $0x0,0x18(%rsp)
jmp    140b <csv_to_json+0x25b>
mov    %eax,%ebp
mov    0x2b97(%rip),%rax
mov    (%rax),%edi
lea    0xbae(%rip),%rsi
lea    0xbbd(%rip),%rcx
mov    $0x2f0,%edx
jmp    173f <csv_to_json+0x58f>
mov    $0x1,%eax
mov    %rax,0x20(%rsp)
lea    0x50(%rsp),%rdi
mov    $0x400,%esi
call   1060 <zero_string@plt>
lea    0x450(%rsp),%rdi
mov    $0x400,%esi
call   1060 <zero_string@plt>
cmpl   $0x0,0x4(%rsp)
mov    %r12,0x38(%rsp)
mov    %r13,0x8(%rsp)
jle    16b1 <csv_to_json+0x501>
mov    0x20(%rsp),%rax
add    $0xffffffff,%eax
mov    %eax,0x44(%rsp)
lea    0x450(%rsp),%r13
xor    %ebx,%ebx
xor    %r12d,%r12d
jmp    14eb <csv_to_json+0x33b>
lea    0xc3a(%rip),%rdi
mov    0x8(%rsp),%rsi
lea    0x10(%rsp),%rcx
call   10c0 <xcat@plt>
test   %eax,%eax
js     17d1 <csv_to_json+0x621>
add    $0x1,%r12d
cmp    0x4(%rsp),%r12d
jge    16b3 <csv_to_json+0x503>
mov    %r13,%rdi
lea    0xbe3(%rip),%rsi
mov    %r12d,%edx
call   10d0 <sprintf@plt>
mov    $0xf423f,%edx
mov    %r13,%rdi
mov    0x8(%rsp),%rsi
lea    0x10(%rsp),%rcx
call   10c0 <xcat@plt>
test   %eax,%eax
js     1771 <csv_to_json+0x5c1>
cmpl   $0x0,0x20(%rsp)
mov    %r12,0x48(%rsp)
jle    1625 <csv_to_json+0x475>
xor    %r12d,%r12d
lea    0x50(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r13,%rdi
lea    0xb9c(%rip),%rsi
mov    %r12d,%edx
call   10d0 <sprintf@plt>
mov    $0x400,%edx
mov    %r13,%rdi
mov    %rbp,%rsi
lea    0x28(%rsp),%rcx
call   10c0 <xcat@plt>
mov    0x30(%rsp),%rax
nopl   0x0(%rax)
add    $0x1,%rbx
movzbl -0x1(%rax,%rbx,1),%ecx
cmp    $0xa,%cl
je     15a0 <csv_to_json+0x3f0>
cmp    $0x2c,%cl
je     15a0 <csv_to_json+0x3f0>
movzbl -0x1(%rax,%rbx,1),%ecx
mov    0x28(%rsp),%rdx
lea    0x1(%rdx),%rsi
mov    %rsi,0x28(%rsp)
mov    %cl,0x50(%rsp,%rdx,1)
jmp    1570 <csv_to_json+0x3c0>
nopl   0x0(%rax)
mov    0x28(%rsp),%rax
movb   $0x22,0x50(%rsp,%rax,1)
cmp    0x44(%rsp),%r12d
jge    15c0 <csv_to_json+0x410>
movb   $0x2c,0x51(%rsp,%rax,1)
add    $0x2,%rax
jmp    15c4 <csv_to_json+0x414>
nopl   0x0(%rax)
add    $0x1,%rax
lea    0x1(%rax),%rcx
mov    %rcx,0x28(%rsp)
movb   $0xa,0x50(%rsp,%rax,1)
mov    $0xf423f,%edx
mov    %rbp,%rdi
mov    0x8(%rsp),%rsi
lea    0x10(%rsp),%rcx
call   10c0 <xcat@plt>
test   %eax,%eax
js     167d <csv_to_json+0x4cd>
cmp    %rbx,0x18(%rsp)
je     1625 <csv_to_json+0x475>
mov    %r13,%rdi
call   1030 <zero_string_to_nullc@plt>
lea    0x50(%rsp),%rbp
mov    %rbp,%rdi
call   1030 <zero_string_to_nullc@plt>
movq   $0x0,0x28(%rsp)
add    $0x1,%r12d
cmp    0x20(%rsp),%r12d
jne    1540 <csv_to_json+0x390>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
mov    0x48(%rsp),%r12
mov    $0xf423f,%edx
cmp    %eax,%r12d
jge    14be <csv_to_json+0x30e>
lea    0xab1(%rip),%rdi
mov    0x8(%rsp),%rsi
lea    0x10(%rsp),%rcx
call   10c0 <xcat@plt>
test   %eax,%eax
jns    14dc <csv_to_json+0x32c>
mov    %eax,%ebp
mov    0x297a(%rip),%rax
mov    (%rax),%edi
lea    0x991(%rip),%rsi
lea    0x9a0(%rip),%rcx
mov    $0x312,%edx
jmp    169b <csv_to_json+0x4eb>
mov    %eax,%ebp
mov    0x295a(%rip),%rax
mov    (%rax),%edi
lea    0x971(%rip),%rsi
lea    0x980(%rip),%rcx
mov    $0x30b,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x38(%rsp),%r12
mov    0x8(%rsp),%r13
jmp    1746 <csv_to_json+0x596>
xor    %ebx,%ebx
lea    0xa49(%rip),%rdi
lea    0x10(%rsp),%rcx
mov    $0xf423f,%edx
mov    0x8(%rsp),%r13
mov    %r13,%rsi
call   10c0 <xcat@plt>
mov    %eax,%ebp
test   %eax,%eax
mov    0x38(%rsp),%r12
js     1723 <csv_to_json+0x573>
cmp    0x18(%rsp),%rbx
jne    1753 <csv_to_json+0x5a3>
mov    0x10(%rsp),%rax
lea    0x1(%rax),%rbx
mov    %rbx,0x10(%rsp)
movb   $0x0,0x0(%r13,%rax,1)
mov    %rbx,%rdi
call   1090 <malloc@plt>
mov    %rax,(%r14)
test   %rax,%rax
je     1794 <csv_to_json+0x5e4>
mov    %rax,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
call   1080 <memcpy@plt>
mov    0x10(%rsp),%rax
mov    %rax,(%r15)
jmp    1746 <csv_to_json+0x596>
mov    0x28b6(%rip),%rax
mov    (%rax),%edi
lea    0x8cd(%rip),%rsi
lea    0x8dc(%rip),%rcx
mov    $0x318,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r13,%rdi
call   1040 <free@plt>
jmp    13c5 <csv_to_json+0x215>
mov    0x2886(%rip),%rax
mov    (%rax),%edi
lea    0x89d(%rip),%rsi
lea    0x8ac(%rip),%rcx
mov    $0x319,%edx
jmp    17c0 <csv_to_json+0x610>
mov    %eax,%ebp
mov    0x2866(%rip),%rax
mov    (%rax),%edi
lea    0x87d(%rip),%rsi
lea    0x88c(%rip),%rcx
mov    $0x300,%edx
jmp    169b <csv_to_json+0x4eb>
mov    0x2845(%rip),%rbx
mov    (%rbx),%edi
lea    0x919(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%rbx),%edi
lea    0x84c(%rip),%rsi
lea    0x85b(%rip),%rcx
mov    $0x31d,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0xffffffff,%ebp
jmp    1746 <csv_to_json+0x596>
mov    %eax,%ebp
mov    0x2806(%rip),%rax
mov    (%rax),%edi
lea    0x81d(%rip),%rsi
lea    0x82c(%rip),%rcx
mov    $0x315,%edx
jmp    169b <csv_to_json+0x4eb>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.1 = [167 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c\00"
@.str.2 = [27 x i8] c"Unable to allocate memory\0A\00"
@.str.3 = [3 x i8] c"{\0A\00"
@.str.4 = [14 x i8] c" \22r%d\22: {\0A\00"
@.str.5 = [17 x i8] c" \22c%d\22: \22\00"
@.str.6 = [8 x i8] c" },\0A\00"
@.str.7 = [7 x i8] c" }\0A\00"
@.str.8 = [3 x i8] c"}\0A\00"
define i32 @csv_to_json(i8* %0, i8** %1, i64* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i64*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i8*
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
%21 = alloca i32
%22 = alloca i64
%23 = alloca i32
%24 = alloca i8*
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i8*
%29 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i64* %2, i64** %7
store i32 0, i32* %8
store i8* null, i8** %9
store i64 0, i64* %10
store i8* null, i8** %11
store i64 0, i64* %12
store i64 0, i64* %13
store i64 1024, i64* %14
store i64 0, i64* %15
%30 = load i64, i64* %14
%31 = call i8* @llvm.stacksave()
store i8* %31, i8** %16
%32 = alloca i8, i64 %30
store i64 %30, i64* %17
store i64 1024, i64* %18
store i64 0, i64* %19
%33 = load i64, i64* %18
%34 = alloca i8, i64 %33
store i64 %33, i64* %20
store i32 0, i32* %21
%35 = load i8**, i8*** %6
store i8* null, i8** %35
%36 = load i64*, i64** %7
store i64 0, i64* %36
%37 = load i8*, i8** %5
%38 = call i32 @rs_mmap(i8* %37, i8** %11, i64* %12, i32 0)
store i32 %38, i32* %8
%39 = load i32, i32* %8
%40 = icmp slt i32 %39, 0
br i1 %40, label %41, label %45
41: ; preds = %3
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 742, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
%44 = load i32, i32* %8
store i32 %44, i32* %8
br label %295
45: ; preds = %3
%46 = load i8*, i8** %11
%47 = icmp eq i8* %46, null
br i1 %47, label %48, label %51
48: ; preds = %45
%49 = load i32, i32* @stderr
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 743, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %8
br label %295
51: ; preds = %45
%52 = load i64, i64* %12
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %57
54: ; preds = %51
%55 = load i32, i32* @stderr
%56 = call i32 (i32, i8*, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 744, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %8
br label %295
57: ; preds = %51
%58 = load i8*, i8** %5
%59 = call i32 @num_lines(i8* %58, i32* %21)
store i32 %59, i32* %8
%60 = load i32, i32* %8
%61 = icmp slt i32 %60, 0
br i1 %61, label %62, label %66
62: ; preds = %57
%63 = load i32, i32* @stderr
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 745, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
%65 = load i32, i32* %8
store i32 %65, i32* %8
br label %295
66: ; preds = %57
%67 = load i32, i32* %21
%68 = icmp slt i32 %67, 1
br i1 %68, label %69, label %72
69: ; preds = %66
%70 = load i32, i32* @stderr
%71 = call i32 (i32, i8*, ...) @fprintf(i32 %70, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 746, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %8
br label %295
72: ; preds = %66
store i64 999999, i64* %10
%73 = load i64, i64* %10
%74 = mul i64 %73, 1
%75 = call i8* @malloc(i64 %74)
store i8* %75, i8** %9
%76 = load i8*, i8** %9
%77 = icmp eq i8* %76, null
br i1 %77, label %78, label %83
78: ; preds = %72
%79 = load i32, i32* @stderr
%80 = call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%81 = load i32, i32* @stderr
%82 = call i32 (i32, i8*, ...) @fprintf(i32 %81, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 750, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %8
br label %295
83: ; preds = %72
store i64 0, i64* %22
%84 = load i8*, i8** %9
%85 = load i64, i64* %10
%86 = call i32 @xcat(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %84, i64 %85, i64* %22)
store i32 %86, i32* %8
%87 = load i32, i32* %8
%88 = icmp slt i32 %87, 0
br i1 %88, label %89, label %93
89: ; preds = %83
%90 = load i32, i32* @stderr
%91 = call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 752, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
%92 = load i32, i32* %8
store i32 %92, i32* %8
br label %295
93: ; preds = %83
store i32 1, i32* %23
%94 = load i8*, i8** %11
store i8* %94, i8** %24
store i32 0, i32* %25
br label %95
95: ; preds = %116, %93
%96 = load i32, i32* %25
%97 = sext i32 %96 to i64
%98 = load i64, i64* %12
%99 = icmp ult i64 %97, %98
br i1 %99, label %100, label %105
100: ; preds = %95
%101 = load i8*, i8** %24
%102 = load i8, i8* %101
%103 = sext i8 %102 to i32
%104 = icmp ne i32 %103, 10
br label %105
105: ; preds = %100, %95
%106 = phi i1 [ false, %95 ], [ %104, %100 ]
br i1 %106, label %107, label %121
107: ; preds = %105
%108 = load i8*, i8** %24
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 44
br i1 %111, label %112, label %115
112: ; preds = %107
%113 = load i32, i32* %23
%114 = add nsw i32 %113, 1
store i32 %114, i32* %23
br label %115
115: ; preds = %112, %107
br label %116
116: ; preds = %115
%117 = load i32, i32* %25
%118 = add nsw i32 %117, 1
store i32 %118, i32* %25
%119 = load i8*, i8** %24
%120 = getelementptr inbounds i8, i8* %119, i32 1
store i8* %120, i8** %24
br label %95
121: ; preds = %105
%122 = call i32 @zero_string(i8* %32, i32 1024)
%123 = call i32 @zero_string(i8* %34, i32 1024)
store i32 0, i32* %26
store i32 0, i32* %27
store i32 0, i32* %27
br label %124
124: ; preds = %250, %121
%125 = load i32, i32* %27
%126 = load i32, i32* %21
%127 = icmp slt i32 %125, %126
br i1 %127, label %128, label %253
128: ; preds = %124
%129 = load i32, i32* %27
%130 = call i32 @sprintf(i8* %34, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %129)
%131 = load i8*, i8** %9
%132 = load i64, i64* %10
%133 = call i32 @xcat(i8* %34, i8* %131, i64 %132, i64* %22)
store i32 %133, i32* %8
%134 = load i32, i32* %8
%135 = icmp slt i32 %134, 0
br i1 %135, label %136, label %140
136: ; preds = %128
%137 = load i32, i32* @stderr
%138 = call i32 (i32, i8*, ...) @fprintf(i32 %137, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 768, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
%139 = load i32, i32* %8
store i32 %139, i32* %8
br label %295
140: ; preds = %128
store i32 0, i32* %26
br label %141
141: ; preds = %219, %140
%142 = load i32, i32* %26
%143 = load i32, i32* %23
%144 = icmp slt i32 %142, %143
br i1 %144, label %145, label %222
145: ; preds = %141
%146 = load i32, i32* %26
%147 = call i32 @sprintf(i8* %34, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %146)
%148 = load i64, i64* %14
%149 = call i32 @xcat(i8* %34, i8* %32, i64 %148, i64* %15)
%150 = load i32, i32* %8
%151 = icmp slt i32 %150, 0
br i1 %151, label %152, label %156
152: ; preds = %145
%153 = load i32, i32* @stderr
%154 = call i32 (i32, i8*, ...) @fprintf(i32 %153, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 771, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
%155 = load i32, i32* %8
store i32 %155, i32* %8
br label %295
156: ; preds = %145
%157 = load i8*, i8** %11
%158 = load i64, i64* %13
%159 = getelementptr inbounds i8, i8* %157, i64 %158
store i8* %159, i8** %28
br label %160
160: ; preds = %181, %156
%161 = load i8*, i8** %28
%162 = load i8, i8* %161
%163 = sext i8 %162 to i32
%164 = icmp ne i32 %163, 10
br i1 %164, label %165, label %170
165: ; preds = %160
%166 = load i8*, i8** %28
%167 = load i8, i8* %166
%168 = sext i8 %167 to i32
%169 = icmp ne i32 %168, 44
br label %170
170: ; preds = %165, %160
%171 = phi i1 [ false, %160 ], [ %169, %165 ]
br i1 %171, label %172, label %184
172: ; preds = %170
%173 = load i8*, i8** %11
%174 = load i64, i64* %13
%175 = add i64 %174, 1
store i64 %175, i64* %13
%176 = getelementptr inbounds i8, i8* %173, i64 %174
%177 = load i8, i8* %176
%178 = load i64, i64* %15
%179 = add i64 %178, 1
store i64 %179, i64* %15
%180 = getelementptr inbounds i8, i8* %32, i64 %178
store i8 %177, i8* %180
br label %181
181: ; preds = %172
%182 = load i8*, i8** %28
%183 = getelementptr inbounds i8, i8* %182, i32 1
store i8* %183, i8** %28
br label %160
184: ; preds = %170
%185 = load i64, i64* %15
%186 = add i64 %185, 1
store i64 %186, i64* %15
%187 = getelementptr inbounds i8, i8* %32, i64 %185
store i8 34, i8* %187
%188 = load i32, i32* %26
%189 = load i32, i32* %23
%190 = sub nsw i32 %189, 1
%191 = icmp slt i32 %188, %190
br i1 %191, label %192, label %196
192: ; preds = %184
%193 = load i64, i64* %15
%194 = add i64 %193, 1
store i64 %194, i64* %15
%195 = getelementptr inbounds i8, i8* %32, i64 %193
store i8 44, i8* %195
br label %196
196: ; preds = %192, %184
%197 = load i64, i64* %15
%198 = add i64 %197, 1
store i64 %198, i64* %15
%199 = getelementptr inbounds i8, i8* %32, i64 %197
store i8 10, i8* %199
%200 = load i8*, i8** %9
%201 = load i64, i64* %10
%202 = call i32 @xcat(i8* %32, i8* %200, i64 %201, i64* %22)
store i32 %202, i32* %8
%203 = load i32, i32* %8
%204 = icmp slt i32 %203, 0
br i1 %204, label %205, label %209
205: ; preds = %196
%206 = load i32, i32* @stderr
%207 = call i32 (i32, i8*, ...) @fprintf(i32 %206, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 779, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
%208 = load i32, i32* %8
store i32 %208, i32* %8
br label %295
209: ; preds = %196
%210 = load i64, i64* %13
%211 = add i64 %210, 1
store i64 %211, i64* %13
%212 = load i64, i64* %13
%213 = load i64, i64* %12
%214 = icmp eq i64 %212, %213
br i1 %214, label %215, label %216
215: ; preds = %209
br label %222
216: ; preds = %209
%217 = call i32 @zero_string_to_nullc(i8* %34)
store i64 0, i64* %19
%218 = call i32 @zero_string_to_nullc(i8* %32)
store i64 0, i64* %15
br label %219
219: ; preds = %216
%220 = load i32, i32* %26
%221 = add nsw i32 %220, 1
store i32 %221, i32* %26
br label %141
222: ; preds = %215, %141
%223 = load i32, i32* %27
%224 = load i32, i32* %21
%225 = sub nsw i32 %224, 1
%226 = icmp slt i32 %223, %225
br i1 %226, label %227, label %238
227: ; preds = %222
%228 = load i8*, i8** %9
%229 = load i64, i64* %10
%230 = call i32 @xcat(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %228, i64 %229, i64* %22)
store i32 %230, i32* %8
%231 = load i32, i32* %8
%232 = icmp slt i32 %231, 0
br i1 %232, label %233, label %237
233: ; preds = %227
%234 = load i32, i32* @stderr
%235 = call i32 (i32, i8*, ...) @fprintf(i32 %234, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 786, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
%236 = load i32, i32* %8
store i32 %236, i32* %8
br label %295
237: ; preds = %227
br label %249
238: ; preds = %222
%239 = load i8*, i8** %9
%240 = load i64, i64* %10
%241 = call i32 @xcat(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %239, i64 %240, i64* %22)
store i32 %241, i32* %8
%242 = load i32, i32* %8
%243 = icmp slt i32 %242, 0
br i1 %243, label %244, label %248
244: ; preds = %238
%245 = load i32, i32* @stderr
%246 = call i32 (i32, i8*, ...) @fprintf(i32 %245, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 789, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
%247 = load i32, i32* %8
store i32 %247, i32* %8
br label %295
248: ; preds = %238
br label %249
249: ; preds = %248, %237
br label %250
250: ; preds = %249
%251 = load i32, i32* %27
%252 = add nsw i32 %251, 1
store i32 %252, i32* %27
br label %124
253: ; preds = %124
%254 = load i8*, i8** %9
%255 = load i64, i64* %10
%256 = call i32 @xcat(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %254, i64 %255, i64* %22)
store i32 %256, i32* %8
%257 = load i32, i32* %8
%258 = icmp slt i32 %257, 0
br i1 %258, label %259, label %263
259: ; preds = %253
%260 = load i32, i32* @stderr
%261 = call i32 (i32, i8*, ...) @fprintf(i32 %260, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 792, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
%262 = load i32, i32* %8
store i32 %262, i32* %8
br label %295
263: ; preds = %253
%264 = load i64, i64* %13
%265 = load i64, i64* %12
%266 = icmp ne i64 %264, %265
br i1 %266, label %267, label %270
267: ; preds = %263
%268 = load i32, i32* @stderr
%269 = call i32 (i32, i8*, ...) @fprintf(i32 %268, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 793, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %8
br label %295
270: ; preds = %263
%271 = load i8*, i8** %9
%272 = load i64, i64* %22
%273 = add i64 %272, 1
store i64 %273, i64* %22
%274 = getelementptr inbounds i8, i8* %271, i64 %272
store i8 0, i8* %274
%275 = load i64, i64* %22
%276 = mul i64 %275, 1
%277 = call i8* @malloc(i64 %276)
%278 = load i8**, i8*** %6
store i8* %277, i8** %278
%279 = load i8**, i8*** %6
%280 = load i8*, i8** %279
%281 = icmp eq i8* %280, null
br i1 %281, label %282, label %287
282: ; preds = %270
%283 = load i32, i32* @stderr
%284 = call i32 (i32, i8*, ...) @fprintf(i32 %283, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%285 = load i32, i32* @stderr
%286 = call i32 (i32, i8*, ...) @fprintf(i32 %285, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 797, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %8
br label %295
287: ; preds = %270
%288 = load i8**, i8*** %6
%289 = load i8*, i8** %288
%290 = load i8*, i8** %9
%291 = load i64, i64* %22
%292 = call i32 @memcpy(i8* %289, i8* %290, i64 %291)
%293 = load i64, i64* %22
%294 = load i64*, i64** %7
store i64 %293, i64* %294
br label %295
295: ; preds = %287, %282, %267, %259, %244, %233, %205, %152, %136, %89, %78, %69, %62, %54, %48, %41
%296 = load i8*, i8** %9
%297 = icmp ne i8* %296, null
br i1 %297, label %298, label %301
298: ; preds = %295
%299 = load i8*, i8** %9
%300 = call i32 @free(i8* %299)
store i8* null, i8** %9
br label %301
301: ; preds = %298, %295
%302 = load i8*, i8** %11
%303 = icmp eq i8* %302, null
br i1 %303, label %304, label %310
304: ; preds = %301
%305 = load i64, i64* %12
%306 = icmp ne i64 %305, 0
br i1 %306, label %307, label %310
307: ; preds = %304
%308 = load i32, i32* @stderr
%309 = call i32 (i32, i8*, ...) @fprintf(i32 %308, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 802, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %4
store i32 1, i32* %29
br label %328
310: ; preds = %304, %301
%311 = load i8*, i8** %11
%312 = icmp ne i8* %311, null
br i1 %312, label %313, label %319
313: ; preds = %310
%314 = load i64, i64* %12
%315 = icmp eq i64 %314, 0
br i1 %315, label %316, label %319
316: ; preds = %313
%317 = load i32, i32* @stderr
%318 = call i32 (i32, i8*, ...) @fprintf(i32 %317, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 802, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %4
store i32 1, i32* %29
br label %328
319: ; preds = %313, %310
%320 = load i8*, i8** %11
%321 = icmp ne i8* %320, null
br i1 %321, label %322, label %326
322: ; preds = %319
%323 = load i8*, i8** %11
%324 = load i64, i64* %12
%325 = call i32 @munmap(i8* %323, i64 %324)
store i8* null, i8** %11
store i64 0, i64* %12
br label %326
326: ; preds = %322, %319
%327 = load i32, i32* %8
store i32 %327, i32* %4
store i32 1, i32* %29
br label %328
328: ; preds = %326, %316, %307
%329 = load i8*, i8** %16
%330 = load i32, i32* %4
ret i32 %330
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.1 = [167 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c\00"
@.str.2 = [27 x i8] c"Unable to allocate memory\0A\00"
@.str.3 = [3 x i8] c"{\0A\00"
@.str.4 = [14 x i8] c" \22r%d\22: {\0A\00"
@.str.5 = [17 x i8] c" \22c%d\22: \22\00"
@.str.6 = [8 x i8] c" },\0A\00"
@.str.7 = [7 x i8] c" }\0A\00"
@.str.8 = [3 x i8] c"}\0A\00"
define i32 @csv_to_json(i8* %0, i8** nocapture writeonly %1, i64* nocapture writeonly %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i64
%9 = bitcast i8** %4 to i8*
store i8* null, i8** %4
%10 = bitcast i64* %5 to i8*
store i64 0, i64* %5
%11 = bitcast i64* %6 to i8*
store i64 0, i64* %6
%12 = tail call i8* @llvm.stacksave()
%13 = alloca [1024 x i8]
%14 = alloca [1024 x i8]
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%17 = bitcast i32* %7 to i8*
store i32 0, i32* %7
store i8* null, i8** %1
store i64 0, i64* %2
%18 = call i32 @rs_mmap(i8* %0, i8** %4, i64* %5, i32 0)
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %3
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 742, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %193
23: ; preds = %3
%24 = load i8*, i8** %4
%25 = icmp eq i8* %24, null
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load i32, i32* @stderr
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 743, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %193
29: ; preds = %23
%30 = load i64, i64* %5
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load i32, i32* @stderr
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 744, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %193
35: ; preds = %29
%36 = call i32 @num_lines(i8* %0, i32* %7)
%37 = icmp slt i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load i32, i32* @stderr
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 745, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %193
41: ; preds = %35
%42 = load i32, i32* %7
%43 = icmp slt i32 %42, 1
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i32, i32* @stderr
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 746, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %193
47: ; preds = %41
%48 = call dereferenceable_or_null(999999) i8* @malloc(i64 999999)
%49 = icmp eq i8* %48, null
br i1 %49, label %50, label %55
50: ; preds = %47
%51 = load i32, i32* @stderr
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%53 = load i32, i32* @stderr
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 750, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %193
55: ; preds = %47
store i64 0, i64* %8
%56 = call i32 @xcat(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %48, i64 999999, i64* %8)
%57 = icmp slt i32 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i32, i32* @stderr
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 752, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %190
61: ; preds = %55
%62 = load i64, i64* %5
%63 = icmp eq i64 %62, 0
br i1 %63, label %71, label %64
64: ; preds = %61
%65 = load i8*, i8** %4
br label %66
66: ; preds = %64, %82
%67 = phi i64 [ 0, %64 ], [ %84, %82 ]
%68 = phi i8* [ %65, %64 ], [ %85, %82 ]
%69 = phi i32 [ 1, %64 ], [ %83, %82 ]
%70 = load i8, i8* %68
switch i8 %70, label %82 [
i8 10, label %71
i8 44, label %80
]
71: ; preds = %82, %66, %61
%72 = phi i32 [ 1, %61 ], [ %69, %66 ], [ %83, %82 ]
%73 = call i32 @zero_string(i8* %16, i32 1024)
%74 = call i32 @zero_string(i8* %15, i32 1024)
%75 = load i32, i32* %7
%76 = icmp sgt i32 %75, 0
br i1 %76, label %77, label %163
77: ; preds = %71
%78 = icmp sgt i32 %72, 0
%79 = add nsw i32 %72, -1
br label %87
80: ; preds = %66
%81 = add nsw i32 %69, 1
br label %82
82: ; preds = %66, %80
%83 = phi i32 [ %81, %80 ], [ %69, %66 ]
%84 = add nuw i64 %67, 1
%85 = getelementptr inbounds i8, i8* %68, i64 1
%86 = icmp eq i64 %84, %62
br i1 %86, label %71, label %66
87: ; preds = %77, %159
%88 = phi i32 [ 0, %77 ], [ %160, %159 ]
%89 = phi i64 [ 0, %77 ], [ %143, %159 ]
%90 = call i32 @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %88)
%91 = call i32 @xcat(i8* %15, i8* %48, i64 999999, i64* %8)
%92 = icmp slt i32 %91, 0
br i1 %92, label %94, label %93
93: ; preds = %87
br i1 %78, label %97, label %142
94: ; preds = %87
%95 = load i32, i32* @stderr
%96 = call i32 (i32, i8*, ...) @fprintf(i32 %95, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 768, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %190
97: ; preds = %93, %137
%98 = phi i32 [ %140, %137 ], [ 0, %93 ]
%99 = phi i64 [ %131, %137 ], [ %89, %93 ]
%100 = call i32 @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %98)
%101 = call i32 @xcat(i8* %15, i8* %16, i64 1024, i64* %6)
%102 = load i8*, i8** %4
%103 = getelementptr inbounds i8, i8* %102, i64 %99
br label %104
104: ; preds = %108, %97
%105 = phi i64 [ %99, %97 ], [ %109, %108 ]
%106 = phi i8* [ %103, %97 ], [ %115, %108 ]
%107 = load i8, i8* %106
switch i8 %107, label %108 [
i8 10, label %116
i8 44, label %116
]
108: ; preds = %104
%109 = add i64 %105, 1
%110 = getelementptr inbounds i8, i8* %102, i64 %105
%111 = load i8, i8* %110
%112 = load i64, i64* %6
%113 = add i64 %112, 1
store i64 %113, i64* %6
%114 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 %112
store i8 %111, i8* %114
%115 = getelementptr inbounds i8, i8* %106, i64 1
br label %104
116: ; preds = %104, %104
%117 = load i64, i64* %6
%118 = add i64 %117, 1
%119 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 %117
store i8 34, i8* %119
%120 = icmp slt i32 %98, %79
br i1 %120, label %121, label %124
121: ; preds = %116
%122 = add i64 %117, 2
%123 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 %118
store i8 44, i8* %123
br label %124
124: ; preds = %121, %116
%125 = phi i64 [ %122, %121 ], [ %118, %116 ]
%126 = add i64 %125, 1
store i64 %126, i64* %6
%127 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 %125
store i8 10, i8* %127
%128 = call i32 @xcat(i8* %16, i8* %48, i64 999999, i64* %8)
%129 = icmp slt i32 %128, 0
br i1 %129, label %134, label %130
130: ; preds = %124
%131 = add i64 %105, 1
%132 = load i64, i64* %5
%133 = icmp eq i64 %131, %132
br i1 %133, label %142, label %137
134: ; preds = %124
%135 = load i32, i32* @stderr
%136 = call i32 (i32, i8*, ...) @fprintf(i32 %135, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 779, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %190
137: ; preds = %130
%138 = call i32 @zero_string_to_nullc(i8* %15)
%139 = call i32 @zero_string_to_nullc(i8* %16)
store i64 0, i64* %6
%140 = add nuw nsw i32 %98, 1
%141 = icmp eq i32 %140, %72
br i1 %141, label %142, label %97
142: ; preds = %137, %130, %93
%143 = phi i64 [ %89, %93 ], [ %131, %130 ], [ %131, %137 ]
%144 = load i32, i32* %7
%145 = add nsw i32 %144, -1
%146 = icmp slt i32 %88, %145
br i1 %146, label %147, label %153
147: ; preds = %142
%148 = call i32 @xcat(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %48, i64 999999, i64* %8)
%149 = icmp slt i32 %148, 0
br i1 %149, label %150, label %159
150: ; preds = %147
%151 = load i32, i32* @stderr
%152 = call i32 (i32, i8*, ...) @fprintf(i32 %151, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 786, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %190
153: ; preds = %142
%154 = call i32 @xcat(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %48, i64 999999, i64* %8)
%155 = icmp slt i32 %154, 0
br i1 %155, label %156, label %159
156: ; preds = %153
%157 = load i32, i32* @stderr
%158 = call i32 (i32, i8*, ...) @fprintf(i32 %157, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 789, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %190
159: ; preds = %147, %153
%160 = add nuw nsw i32 %88, 1
%161 = load i32, i32* %7
%162 = icmp slt i32 %160, %161
br i1 %162, label %87, label %163
163: ; preds = %159, %71
%164 = phi i64 [ 0, %71 ], [ %143, %159 ]
%165 = call i32 @xcat(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %48, i64 999999, i64* %8)
%166 = icmp slt i32 %165, 0
br i1 %166, label %167, label %170
167: ; preds = %163
%168 = load i32, i32* @stderr
%169 = call i32 (i32, i8*, ...) @fprintf(i32 %168, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 792, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %190
170: ; preds = %163
%171 = load i64, i64* %5
%172 = icmp eq i64 %164, %171
br i1 %172, label %176, label %173
173: ; preds = %170
%174 = load i32, i32* @stderr
%175 = call i32 (i32, i8*, ...) @fprintf(i32 %174, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 793, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %190
176: ; preds = %170
%177 = load i64, i64* %8
%178 = add i64 %177, 1
store i64 %178, i64* %8
%179 = getelementptr inbounds i8, i8* %48, i64 %177
store i8 0, i8* %179
%180 = call i8* @malloc(i64 %178)
store i8* %180, i8** %1
%181 = icmp eq i8* %180, null
br i1 %181, label %182, label %187
182: ; preds = %176
%183 = load i32, i32* @stderr
%184 = call i32 (i32, i8*, ...) @fprintf(i32 %183, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%185 = load i32, i32* @stderr
%186 = call i32 (i32, i8*, ...) @fprintf(i32 %185, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 797, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %190
187: ; preds = %176
%188 = call i32 @memcpy(i8* %180, i8* %48, i64 %178)
%189 = load i64, i64* %8
store i64 %189, i64* %2
br label %190
190: ; preds = %94, %150, %156, %167, %173, %134, %187, %182, %58
%191 = phi i32 [ %165, %187 ], [ -1, %182 ], [ %56, %58 ], [ %91, %94 ], [ %128, %134 ], [ %148, %150 ], [ %154, %156 ], [ %165, %167 ], [ -1, %173 ]
%192 = call i32 @free(i8* %48)
br label %193
193: ; preds = %50, %44, %38, %32, %26, %20, %190
%194 = phi i32 [ %191, %190 ], [ -1, %50 ], [ -1, %44 ], [ %36, %38 ], [ -1, %32 ], [ -1, %26 ], [ %18, %20 ]
%195 = load i8*, i8** %4
%196 = icmp eq i8* %195, null
%197 = load i64, i64* %5
%198 = icmp ne i64 %197, 0
%199 = select i1 %196, i1 %198, i1 false
br i1 %199, label %200, label %203
200: ; preds = %193
%201 = load i32, i32* @stderr
%202 = call i32 (i32, i8*, ...) @fprintf(i32 %201, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 802, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %213
203: ; preds = %193
%204 = icmp ne i8* %195, null
%205 = icmp eq i64 %197, 0
%206 = select i1 %204, i1 %205, i1 false
br i1 %206, label %207, label %210
207: ; preds = %203
%208 = load i32, i32* @stderr
%209 = call i32 (i32, i8*, ...) @fprintf(i32 %208, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 802, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %213
210: ; preds = %203
br i1 %204, label %211, label %213
211: ; preds = %210
%212 = call i32 @munmap(i8* %195, i64 %197)
store i8* null, i8** %4
store i64 0, i64* %5
br label %213
213: ; preds = %210, %211, %207, %200
%214 = phi i32 [ -1, %200 ], [ -1, %207 ], [ %194, %211 ], [ %194, %210 ]
ret i32 %214
}