#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 CopyOrSkip(char *, char *, int *, int *);
int /*<<< orphan*/ SafeFree(char *, char *, int);
char *SafeMalloc(int, char *, int);
char *SafeRealloc(char *, int, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, unsigned int);
char *sgml(char *c, int verbatim) {
  static char safe[4][256], *malloced[4] = {NULL, NULL, NULL, NULL};
  static int which = 0;
  int copy = 0, skip = 0;
  int i = 0, j = 0, delta = 10, len = 256 - delta;
  char *ret;
  which = (which + 1) % 4;
  ret = safe[which];
  safe[which][0] = 0;
  if (malloced[which]) {
    SafeFree(malloced[which],
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/farhi/idl2matlab/refs/heads/master/"
             "cxref/sgml.c",
             962);
    malloced[which] = NULL;
  }
  if (c) {
    i = CopyOrSkip(c, "sgml", &copy, &skip);
    while (1) {
      for (; j < len && c[i]; i++) {
        if (copy) {
          ret[j++] = c[i];
          if (c[i] == '\n')
            copy = 0;
        } else if (skip) {
          if (c[i] == '\n')
            skip = 0;
        } else if (verbatim)
          switch (c[i]) {
          case '&':
            strcpy(&ret[j], "&ero;");
            j += 5;
            break;
          case '<':
            if (c[i + 1] == '/') {
              strcpy(&ret[j], "&etago;");
              j += 7;
              break;
            }
          default:
            ret[j++] = c[i];
          }
        else
          switch (c[i]) {
          case '<':
            if (c[i + 1] == '/') {
              strcpy(&ret[j], "&etago;");
              j += 7;
            } else {
              strcpy(&ret[j], "&lt;");
              j += 4;
            }
            break;
          case '>':
            strcpy(&ret[j], "&gt;");
            j += 4;
            break;
          case '"':
            strcpy(&ret[j], "&quot;");
            j += 6;
            break;
          case '&':
            strcpy(&ret[j], "&amp;");
            j += 5;
            break;
          case '$':
            strcpy(&ret[j], "&dollar;");
            j += 8;
            break;
          case '#':
            strcpy(&ret[j], "&num;");
            j += 5;
            break;
          case '%':
            strcpy(&ret[j], "&percnt;");
            j += 8;
            break;
          case '~':
            strcpy(&ret[j], "&tilde;");
            j += 7;
            break;
          case '\n':
            if (j && ret[j - 1] == '\n') {
              strcpy(&ret[j], "<newline>");
              j += 9;
            }
            ret[j++] = c[i];
            break;
          default:
            ret[j++] = c[i];
          }
        if (c[i] == '\n')
          i += CopyOrSkip(c + i, "sgml", &copy, &skip);
      }
      if (c[i]) {
        if (malloced[which])
          malloced[which] =
              SafeRealloc(malloced[which], len + delta + 256,
                          "/scratch/repos/new/home/jordi_armengol_estape/"
                          "c-scraper/outputs/2022-01-22/02-19-57/repos/farhi/"
                          "idl2matlab/refs/heads/master/cxref/sgml.c",
                          1035);
        else {
          malloced[which] =
              SafeMalloc(len + delta + 256,
                         "/scratch/repos/new/home/jordi_armengol_estape/"
                         "c-scraper/outputs/2022-01-22/02-19-57/repos/farhi/"
                         "idl2matlab/refs/heads/master/cxref/sgml.c",
                         1037);
          strncpy(malloced[which], ret, (unsigned)j);
        }
        ret = malloced[which];
        len += 256;
      } else {
        ret[j] = 0;
        break;
      }
    }
  }
  return (ret);
}


x86 assembly (clang, -O0):
<sgml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0xa,-0x20(%rbp)
mov    $0x100,%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    0x32dd(%rip),%eax
add    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,0x32cc(%rip)
movslq 0x32c5(%rip),%rcx
lea    0x2e9e(%rip),%rax
shl    $0x8,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
movslq 0x32ac(%rip),%rcx
lea    0x2e85(%rip),%rax
shl    $0x8,%rcx
add    %rcx,%rax
movb   $0x0,(%rax)
movslq 0x3294(%rip),%rcx
lea    0x326d(%rip),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     1237 <sgml+0xd7>
movslq 0x327b(%rip),%rcx
lea    0x3254(%rip),%rax
mov    (%rax,%rcx,8),%rdi
lea    0xde9(%rip),%rsi
mov    $0x3c2,%edx
call   1070 <SafeFree@plt>
movslq 0x3258(%rip),%rcx
lea    0x3231(%rip),%rax
movq   $0x0,(%rax,%rcx,8)
cmpq   $0x0,-0x8(%rbp)
je     17ca <sgml+0x66a>
mov    -0x8(%rbp),%rdi
lea    0xe3d(%rip),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1080 <CopyOrSkip@plt>
mov    %eax,-0x18(%rbp)
jmp    1262 <sgml+0x102>
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x24(%rbp),%ecx
mov    %al,-0x31(%rbp)
jge    1288 <sgml+0x128>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    1298 <sgml+0x138>
jmp    16c5 <sgml+0x565>
cmpl   $0x0,-0x10(%rbp)
je     12e3 <sgml+0x183>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x1c(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    12de <sgml+0x17e>
movl   $0x0,-0x10(%rbp)
jmp    1678 <sgml+0x518>
cmpl   $0x0,-0x14(%rbp)
je     130e <sgml+0x1ae>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1309 <sgml+0x1a9>
movl   $0x0,-0x14(%rbp)
jmp    1673 <sgml+0x513>
cmpl   $0x0,-0xc(%rbp)
je     13d4 <sgml+0x274>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x38(%rbp)
sub    $0x26,%eax
je     1346 <sgml+0x1e6>
jmp    1335 <sgml+0x1d5>
mov    -0x38(%rbp),%eax
sub    $0x3c,%eax
je     136b <sgml+0x20b>
jmp    13af <sgml+0x24f>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xd37(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x1c(%rbp)
jmp    13cf <sgml+0x26f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    13aa <sgml+0x24a>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xcfe(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x1c(%rbp)
jmp    13cf <sgml+0x26f>
jmp    13af <sgml+0x24f>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x1c(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    166e <sgml+0x50e>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x3c(%rbp)
sub    $0xa,%eax
je     15e0 <sgml+0x480>
jmp    13f1 <sgml+0x291>
mov    -0x3c(%rbp),%eax
sub    $0x22,%eax
je     1502 <sgml+0x3a2>
jmp    1402 <sgml+0x2a2>
mov    -0x3c(%rbp),%eax
sub    $0x23,%eax
je     1571 <sgml+0x411>
jmp    1413 <sgml+0x2b3>
mov    -0x3c(%rbp),%eax
sub    $0x24,%eax
je     154c <sgml+0x3ec>
jmp    1424 <sgml+0x2c4>
mov    -0x3c(%rbp),%eax
sub    $0x25,%eax
je     1596 <sgml+0x436>
jmp    1435 <sgml+0x2d5>
mov    -0x3c(%rbp),%eax
sub    $0x26,%eax
je     1527 <sgml+0x3c7>
jmp    1446 <sgml+0x2e6>
mov    -0x3c(%rbp),%eax
sub    $0x3c,%eax
je     1479 <sgml+0x319>
jmp    1457 <sgml+0x2f7>
mov    -0x3c(%rbp),%eax
sub    $0x3e,%eax
je     14dd <sgml+0x37d>
jmp    1468 <sgml+0x308>
mov    -0x3c(%rbp),%eax
sub    $0x7e,%eax
je     15bb <sgml+0x45b>
jmp    1649 <sgml+0x4e9>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    14b8 <sgml+0x358>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xbf0(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x1c(%rbp)
jmp    14d8 <sgml+0x378>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xbd3(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x1c(%rbp)
jmp    1669 <sgml+0x509>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xbb3(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x1c(%rbp)
jmp    1669 <sgml+0x509>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xb93(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x1c(%rbp)
jmp    1669 <sgml+0x509>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xb75(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x1c(%rbp)
jmp    1669 <sgml+0x509>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xb56(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x1c(%rbp)
jmp    1669 <sgml+0x509>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xb3a(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x1c(%rbp)
jmp    1669 <sgml+0x509>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xb1b(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x1c(%rbp)
jmp    1669 <sgml+0x509>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xaff(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x1c(%rbp)
jmp    1669 <sgml+0x509>
cmpl   $0x0,-0x1c(%rbp)
je     1624 <sgml+0x4c4>
mov    -0x30(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1624 <sgml+0x4c4>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xabe(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x9,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x1c(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1669 <sgml+0x509>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x1c(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    166e <sgml+0x50e>
jmp    1673 <sgml+0x513>
jmp    1678 <sgml+0x518>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    16b2 <sgml+0x552>
mov    -0x8(%rbp),%rdi
movslq -0x18(%rbp),%rax
add    %rax,%rdi
lea    0x9eb(%rip),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1080 <CopyOrSkip@plt>
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    16b7 <sgml+0x557>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1262 <sgml+0x102>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     17af <sgml+0x64f>
movslq 0x2da2(%rip),%rcx
lea    0x2d7b(%rip),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     1739 <sgml+0x5d9>
movslq 0x2d89(%rip),%rcx
lea    0x2d62(%rip),%rax
mov    (%rax,%rcx,8),%rdi
mov    -0x24(%rbp),%esi
add    -0x20(%rbp),%esi
add    $0x100,%esi
lea    0x8eb(%rip),%rdx
mov    $0x40b,%ecx
call   1050 <SafeRealloc@plt>
mov    %rax,%rdx
movslq 0x2d57(%rip),%rcx
lea    0x2d30(%rip),%rax
mov    %rdx,(%rax,%rcx,8)
jmp    1789 <sgml+0x629>
mov    -0x24(%rbp),%edi
add    -0x20(%rbp),%edi
add    $0x100,%edi
lea    0x8b4(%rip),%rsi
mov    $0x40d,%edx
call   1060 <SafeMalloc@plt>
mov    %rax,%rdx
movslq 0x2d20(%rip),%rcx
lea    0x2cf9(%rip),%rax
mov    %rdx,(%rax,%rcx,8)
movslq 0x2d0e(%rip),%rcx
lea    0x2ce7(%rip),%rax
mov    (%rax,%rcx,8),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncpy@plt>
movslq 0x2cf0(%rip),%rcx
lea    0x2cc9(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
add    $0x100,%eax
mov    %eax,-0x24(%rbp)
jmp    17c0 <sgml+0x660>
mov    -0x30(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    17c5 <sgml+0x665>
jmp    125d <sgml+0xfd>
jmp    17ca <sgml+0x66a>
mov    -0x30(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgml>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,0x14(%rsp)
mov    %rdi,%rbx
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
mov    0x32f5(%rip),%eax
lea    0x1(%rax),%ecx
lea    0x4(%rax),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xfffffffc,%edx
neg    %edx
lea    (%rax,%rdx,1),%r14d
add    $0x1,%r14d
mov    %r14d,0x32d6(%rip)
lea    0x32af(%rip),%rbp
mov    0x0(%rbp,%r14,8),%rdi
shl    $0x8,%r14
lea    0x2e9f(%rip),%rax
mov    %rax,%r15
movb   $0x0,(%r14,%rax,1)
test   %rdi,%rdi
je     11ee <sgml+0x8e>
lea    0xeff(%rip),%rsi
mov    $0x3c2,%edx
call   1070 <SafeFree@plt>
mov    0x329b(%rip),%eax
movq   $0x0,0x0(%rbp,%rax,8)
mov    %r15,%rbp
add    %r14,%rbp
test   %rbx,%rbx
je     1516 <sgml+0x3b6>
lea    0xf5a(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
call   1080 <CopyOrSkip@plt>
mov    %eax,%r14d
mov    $0xf6,%r13d
xor    %r15d,%r15d
jmp    1250 <sgml+0xf0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12,%rdi
lea    0xf24(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1080 <CopyOrSkip@plt>
add    %eax,%r14d
add    $0x1,%r14d
cmp    %r13d,%r15d
jge    12f3 <sgml+0x193>
movslq %r14d,%rcx
movsbl (%rbx,%rcx,1),%eax
test   %eax,%eax
je     12f3 <sgml+0x193>
lea    (%rbx,%rcx,1),%r12
cmpl   $0x0,0x10(%rsp)
je     1290 <sgml+0x130>
movslq %r15d,%rcx
add    $0x1,%r15d
mov    %al,0x0(%rbp,%rcx,1)
cmpb   $0xa,(%r12)
jne    124c <sgml+0xec>
movl   $0x0,0x10(%rsp)
jmp    1230 <sgml+0xd0>
nop
cmpl   $0x0,0xc(%rsp)
je     12b0 <sgml+0x150>
cmp    $0xa,%al
jne    14e0 <sgml+0x380>
movl   $0x0,0xc(%rsp)
cmpb   $0xa,(%r12)
je     1230 <sgml+0xd0>
jmp    124c <sgml+0xec>
cmpl   $0x0,0x14(%rsp)
je     134c <sgml+0x1ec>
cmp    $0x3c,%eax
je     13df <sgml+0x27f>
cmp    $0x26,%eax
jne    14f3 <sgml+0x393>
movslq %r15d,%rdi
add    %rbp,%rdi
lea    0xe89(%rip),%rsi
call   1040 <strcpy@plt>
add    $0x5,%r15d
cmpb   $0xa,(%r12)
je     1230 <sgml+0xd0>
jmp    124c <sgml+0xec>
movslq %r14d,%rax
cmpb   $0x0,(%rbx,%rax,1)
je     150e <sgml+0x3ae>
mov    %rbp,%r12
mov    0x3177(%rip),%eax
lea    0x3150(%rip),%rbp
mov    0x0(%rbp,%rax,8),%rdi
lea    0x10a(%r13),%esi
test   %rdi,%rdi
je     139c <sgml+0x23c>
lea    0xdac(%rip),%rdx
mov    $0x40b,%ecx
call   1050 <SafeRealloc@plt>
mov    0x3148(%rip),%ecx
mov    %rax,0x0(%rbp,%rcx,8)
mov    %rax,%rbp
add    $0x100,%r13d
jmp    1250 <sgml+0xf0>
lea    -0xa(%rax),%edx
cmp    $0x34,%edx
ja     1410 <sgml+0x2b0>
lea    0xca1(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
test   %r15d,%r15d
je     14f0 <sgml+0x390>
movslq %r15d,%rdi
cmpb   $0xa,-0x1(%rdi,%rbp,1)
jne    14f3 <sgml+0x393>
add    %rbp,%rdi
lea    0xe1f(%rip),%rsi
call   1040 <strcpy@plt>
add    $0x9,%r15d
movzbl (%r12),%eax
jmp    14f3 <sgml+0x393>
mov    %esi,%edi
lea    0xd2f(%rip),%rsi
mov    $0x40d,%edx
call   1060 <SafeMalloc@plt>
mov    0x30cb(%rip),%ecx
mov    %rax,0x0(%rbp,%rcx,8)
mov    %rax,%rdi
mov    %r12,%rsi
mov    %r15d,%edx
call   1030 <strncpy@plt>
mov    0x30b2(%rip),%eax
mov    0x0(%rbp,%rax,8),%rbp
add    $0x100,%r13d
jmp    1250 <sgml+0xf0>
cmpb   $0x2f,0x1(%rcx,%rbx,1)
jne    14f3 <sgml+0x393>
movslq %r15d,%rdi
add    %rbp,%rdi
lea    0xd72(%rip),%rsi
call   1040 <strcpy@plt>
add    $0x7,%r15d
cmpb   $0xa,(%r12)
je     1230 <sgml+0xd0>
jmp    124c <sgml+0xec>
cmp    $0x7e,%eax
jne    14f3 <sgml+0x393>
movslq %r15d,%rdi
add    %rbp,%rdi
lea    0xd7a(%rip),%rsi
jmp    13f7 <sgml+0x297>
movslq %r15d,%rdi
add    %rbp,%rdi
lea    0xd46(%rip),%rsi
call   1040 <strcpy@plt>
add    $0x6,%r15d
cmpb   $0xa,(%r12)
je     1230 <sgml+0xd0>
jmp    124c <sgml+0xec>
movslq %r15d,%rdi
add    %rbp,%rdi
lea    0xd36(%rip),%rsi
jmp    12da <sgml+0x17a>
movslq %r15d,%rdi
add    %rbp,%rdi
lea    0xd1b(%rip),%rsi
jmp    147c <sgml+0x31c>
movslq %r15d,%rdi
add    %rbp,%rdi
lea    0xd1b(%rip),%rsi
call   1040 <strcpy@plt>
add    $0x8,%r15d
cmpb   $0xa,(%r12)
je     1230 <sgml+0xd0>
jmp    124c <sgml+0xec>
movslq %r15d,%rdi
add    %rbp,%rdi
lea    0xce0(%rip),%rsi
jmp    12da <sgml+0x17a>
movslq %r15d,%rdi
add    %rbp,%rdi
cmpb   $0x2f,0x1(%rcx,%rbx,1)
je     13f0 <sgml+0x290>
lea    0xcb2(%rip),%rsi
jmp    14ce <sgml+0x36e>
movslq %r15d,%rdi
add    %rbp,%rdi
lea    0xca8(%rip),%rsi
call   1040 <strcpy@plt>
add    $0x4,%r15d
nopw   0x0(%rax,%rax,1)
cmpb   $0xa,(%r12)
je     1230 <sgml+0xd0>
jmp    124c <sgml+0xec>
xor    %r15d,%r15d
movslq %r15d,%rcx
add    $0x1,%r15d
mov    %al,0x0(%rbp,%rcx,1)
cmpb   $0xa,(%r12)
je     1230 <sgml+0xd0>
jmp    124c <sgml+0xec>
movslq %r15d,%rax
movb   $0x0,0x0(%rbp,%rax,1)
mov    %rbp,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@sgml.safe = internal global [4 x [256 x i8]] zeroinitializer
@sgml.malloced = internal global [4 x i8*] zeroinitializer
@sgml.which = internal global i32 0
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/farhi/idl2matlab/refs/heads/master/cxref/sgml.c\00"
@.str.1 = [5 x i8] c"sgml\00"
@.str.2 = [6 x i8] c"&ero;\00"
@.str.3 = [8 x i8] c"&etago;\00"
@.str.4 = [5 x i8] c"&lt;\00"
@.str.5 = [5 x i8] c"&gt;\00"
@.str.6 = [7 x i8] c"&quot;\00"
@.str.7 = [6 x i8] c"&amp;\00"
@.str.8 = [9 x i8] c"&dollar;\00"
@.str.9 = [6 x i8] c"&num;\00"
@.str.10 = [9 x i8] c"&percnt;\00"
@.str.11 = [8 x i8] c"&tilde;\00"
@.str.12 = [10 x i8] c"<newline>\00"
define i8* @sgml(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 10, i32* %9
%12 = load i32, i32* %9
%13 = sub nsw i32 256, %12
store i32 %13, i32* %10
%14 = load i32, i32* @sgml.which
%15 = add nsw i32 %14, 1
%16 = srem i32 %15, 4
store i32 %16, i32* @sgml.which
%17 = load i32, i32* @sgml.which
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [4 x [256 x i8]], [4 x [256 x i8]]* @sgml.safe, i64 0, i64 %18
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
store i8* %20, i8** %11
%21 = load i32, i32* @sgml.which
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [4 x [256 x i8]], [4 x [256 x i8]]* @sgml.safe, i64 0, i64 %22
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %23, i64 0, i64 0
store i8 0, i8* %24
%25 = load i32, i32* @sgml.which
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %26
%28 = load i8*, i8** %27
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %39
30: ; preds = %2
%31 = load i32, i32* @sgml.which
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %32
%34 = load i8*, i8** %33
%35 = call i32 @SafeFree(i8* %34, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 962)
%36 = load i32, i32* @sgml.which
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %37
store i8* null, i8** %38
br label %39
39: ; preds = %30, %2
%40 = load i8*, i8** %3
%41 = icmp ne i8* %40, null
br i1 %41, label %42, label %354
42: ; preds = %39
%43 = load i8*, i8** %3
%44 = call i32 @CopyOrSkip(i8* %43, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6)
store i32 %44, i32* %7
br label %45
45: ; preds = %42, %352
br label %46
46: ; preds = %295, %45
%47 = load i32, i32* %8
%48 = load i32, i32* %10
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %58
50: ; preds = %46
%51 = load i8*, i8** %3
%52 = load i32, i32* %7
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %51, i64 %53
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp ne i32 %56, 0
br label %58
58: ; preds = %50, %46
%59 = phi i1 [ false, %46 ], [ %57, %50 ]
br i1 %59, label %60, label %298
60: ; preds = %58
%61 = load i32, i32* %5
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %83
63: ; preds = %60
%64 = load i8*, i8** %3
%65 = load i32, i32* %7
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %64, i64 %66
%68 = load i8, i8* %67
%69 = load i8*, i8** %11
%70 = load i32, i32* %8
%71 = add nsw i32 %70, 1
store i32 %71, i32* %8
%72 = sext i32 %70 to i64
%73 = getelementptr inbounds i8, i8* %69, i64 %72
store i8 %68, i8* %73
%74 = load i8*, i8** %3
%75 = load i32, i32* %7
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8, i8* %74, i64 %76
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp eq i32 %79, 10
br i1 %80, label %81, label %82
81: ; preds = %63
store i32 0, i32* %5
br label %82
82: ; preds = %81, %63
br label %278
83: ; preds = %60
%84 = load i32, i32* %6
%85 = icmp ne i32 %84, 0
br i1 %85, label %86, label %96
86: ; preds = %83
%87 = load i8*, i8** %3
%88 = load i32, i32* %7
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8, i8* %87, i64 %89
%91 = load i8, i8* %90
%92 = sext i8 %91 to i32
%93 = icmp eq i32 %92, 10
br i1 %93, label %94, label %95
94: ; preds = %86
store i32 0, i32* %6
br label %95
95: ; preds = %94, %86
br label %277
96: ; preds = %83
%97 = load i32, i32* %4
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %144
99: ; preds = %96
%100 = load i8*, i8** %3
%101 = load i32, i32* %7
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i8, i8* %100, i64 %102
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
switch i32 %105, label %132 [
i32 38, label %106
i32 60, label %114
]
106: ; preds = %99
%107 = load i8*, i8** %11
%108 = load i32, i32* %8
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8, i8* %107, i64 %109
%111 = call i32 @strcpy(i8* %110, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%112 = load i32, i32* %8
%113 = add nsw i32 %112, 5
store i32 %113, i32* %8
br label %143
114: ; preds = %99
%115 = load i8*, i8** %3
%116 = load i32, i32* %7
%117 = add nsw i32 %116, 1
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8, i8* %115, i64 %118
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp eq i32 %121, 47
br i1 %122, label %123, label %131
123: ; preds = %114
%124 = load i8*, i8** %11
%125 = load i32, i32* %8
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds i8, i8* %124, i64 %126
%128 = call i32 @strcpy(i8* %127, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%129 = load i32, i32* %8
%130 = add nsw i32 %129, 7
store i32 %130, i32* %8
br label %143
131: ; preds = %114
br label %132
132: ; preds = %99, %131
%133 = load i8*, i8** %3
%134 = load i32, i32* %7
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i8, i8* %133, i64 %135
%137 = load i8, i8* %136
%138 = load i8*, i8** %11
%139 = load i32, i32* %8
%140 = add nsw i32 %139, 1
store i32 %140, i32* %8
%141 = sext i32 %139 to i64
%142 = getelementptr inbounds i8, i8* %138, i64 %141
store i8 %137, i8* %142
br label %143
143: ; preds = %132, %123, %106
br label %276
144: ; preds = %96
%145 = load i8*, i8** %3
%146 = load i32, i32* %7
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i8, i8* %145, i64 %147
%149 = load i8, i8* %148
%150 = sext i8 %149 to i32
switch i32 %150, label %264 [
i32 60, label %151
i32 62, label %177
i32 34, label %185
i32 38, label %193
i32 36, label %201
i32 35, label %209
i32 37, label %217
i32 126, label %225
i32 10, label %233
]
151: ; preds = %144
%152 = load i8*, i8** %3
%153 = load i32, i32* %7
%154 = add nsw i32 %153, 1
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i8, i8* %152, i64 %155
%157 = load i8, i8* %156
%158 = sext i8 %157 to i32
%159 = icmp eq i32 %158, 47
br i1 %159, label %160, label %168
160: ; preds = %151
%161 = load i8*, i8** %11
%162 = load i32, i32* %8
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds i8, i8* %161, i64 %163
%165 = call i32 @strcpy(i8* %164, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%166 = load i32, i32* %8
%167 = add nsw i32 %166, 7
store i32 %167, i32* %8
br label %176
168: ; preds = %151
%169 = load i8*, i8** %11
%170 = load i32, i32* %8
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds i8, i8* %169, i64 %171
%173 = call i32 @strcpy(i8* %172, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%174 = load i32, i32* %8
%175 = add nsw i32 %174, 4
store i32 %175, i32* %8
br label %176
176: ; preds = %168, %160
br label %275
177: ; preds = %144
%178 = load i8*, i8** %11
%179 = load i32, i32* %8
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds i8, i8* %178, i64 %180
%182 = call i32 @strcpy(i8* %181, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%183 = load i32, i32* %8
%184 = add nsw i32 %183, 4
store i32 %184, i32* %8
br label %275
185: ; preds = %144
%186 = load i8*, i8** %11
%187 = load i32, i32* %8
%188 = sext i32 %187 to i64
%189 = getelementptr inbounds i8, i8* %186, i64 %188
%190 = call i32 @strcpy(i8* %189, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%191 = load i32, i32* %8
%192 = add nsw i32 %191, 6
store i32 %192, i32* %8
br label %275
193: ; preds = %144
%194 = load i8*, i8** %11
%195 = load i32, i32* %8
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds i8, i8* %194, i64 %196
%198 = call i32 @strcpy(i8* %197, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%199 = load i32, i32* %8
%200 = add nsw i32 %199, 5
store i32 %200, i32* %8
br label %275
201: ; preds = %144
%202 = load i8*, i8** %11
%203 = load i32, i32* %8
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds i8, i8* %202, i64 %204
%206 = call i32 @strcpy(i8* %205, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%207 = load i32, i32* %8
%208 = add nsw i32 %207, 8
store i32 %208, i32* %8
br label %275
209: ; preds = %144
%210 = load i8*, i8** %11
%211 = load i32, i32* %8
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds i8, i8* %210, i64 %212
%214 = call i32 @strcpy(i8* %213, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%215 = load i32, i32* %8
%216 = add nsw i32 %215, 5
store i32 %216, i32* %8
br label %275
217: ; preds = %144
%218 = load i8*, i8** %11
%219 = load i32, i32* %8
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds i8, i8* %218, i64 %220
%222 = call i32 @strcpy(i8* %221, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%223 = load i32, i32* %8
%224 = add nsw i32 %223, 8
store i32 %224, i32* %8
br label %275
225: ; preds = %144
%226 = load i8*, i8** %11
%227 = load i32, i32* %8
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds i8, i8* %226, i64 %228
%230 = call i32 @strcpy(i8* %229, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%231 = load i32, i32* %8
%232 = add nsw i32 %231, 7
store i32 %232, i32* %8
br label %275
233: ; preds = %144
%234 = load i32, i32* %8
%235 = icmp ne i32 %234, 0
br i1 %235, label %236, label %253
236: ; preds = %233
%237 = load i8*, i8** %11
%238 = load i32, i32* %8
%239 = sub nsw i32 %238, 1
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds i8, i8* %237, i64 %240
%242 = load i8, i8* %241
%243 = sext i8 %242 to i32
%244 = icmp eq i32 %243, 10
br i1 %244, label %245, label %253
245: ; preds = %236
%246 = load i8*, i8** %11
%247 = load i32, i32* %8
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds i8, i8* %246, i64 %248
%250 = call i32 @strcpy(i8* %249, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
%251 = load i32, i32* %8
%252 = add nsw i32 %251, 9
store i32 %252, i32* %8
br label %253
253: ; preds = %245, %236, %233
%254 = load i8*, i8** %3
%255 = load i32, i32* %7
%256 = sext i32 %255 to i64
%257 = getelementptr inbounds i8, i8* %254, i64 %256
%258 = load i8, i8* %257
%259 = load i8*, i8** %11
%260 = load i32, i32* %8
%261 = add nsw i32 %260, 1
store i32 %261, i32* %8
%262 = sext i32 %260 to i64
%263 = getelementptr inbounds i8, i8* %259, i64 %262
store i8 %258, i8* %263
br label %275
264: ; preds = %144
%265 = load i8*, i8** %3
%266 = load i32, i32* %7
%267 = sext i32 %266 to i64
%268 = getelementptr inbounds i8, i8* %265, i64 %267
%269 = load i8, i8* %268
%270 = load i8*, i8** %11
%271 = load i32, i32* %8
%272 = add nsw i32 %271, 1
store i32 %272, i32* %8
%273 = sext i32 %271 to i64
%274 = getelementptr inbounds i8, i8* %270, i64 %273
store i8 %269, i8* %274
br label %275
275: ; preds = %264, %253, %225, %217, %209, %201, %193, %185, %177, %176
br label %276
276: ; preds = %275, %143
br label %277
277: ; preds = %276, %95
br label %278
278: ; preds = %277, %82
%279 = load i8*, i8** %3
%280 = load i32, i32* %7
%281 = sext i32 %280 to i64
%282 = getelementptr inbounds i8, i8* %279, i64 %281
%283 = load i8, i8* %282
%284 = sext i8 %283 to i32
%285 = icmp eq i32 %284, 10
br i1 %285, label %286, label %294
286: ; preds = %278
%287 = load i8*, i8** %3
%288 = load i32, i32* %7
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds i8, i8* %287, i64 %289
%291 = call i32 @CopyOrSkip(i8* %290, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6)
%292 = load i32, i32* %7
%293 = add nsw i32 %292, %291
store i32 %293, i32* %7
br label %294
294: ; preds = %286, %278
br label %295
295: ; preds = %294
%296 = load i32, i32* %7
%297 = add nsw i32 %296, 1
store i32 %297, i32* %7
br label %46
298: ; preds = %58
%299 = load i8*, i8** %3
%300 = load i32, i32* %7
%301 = sext i32 %300 to i64
%302 = getelementptr inbounds i8, i8* %299, i64 %301
%303 = load i8, i8* %302
%304 = icmp ne i8 %303, 0
br i1 %304, label %305, label %347
305: ; preds = %298
%306 = load i32, i32* @sgml.which
%307 = sext i32 %306 to i64
%308 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %307
%309 = load i8*, i8** %308
%310 = icmp ne i8* %309, null
br i1 %310, label %311, label %324
311: ; preds = %305
%312 = load i32, i32* @sgml.which
%313 = sext i32 %312 to i64
%314 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %313
%315 = load i8*, i8** %314
%316 = load i32, i32* %10
%317 = load i32, i32* %9
%318 = add nsw i32 %316, %317
%319 = add nsw i32 %318, 256
%320 = call i8* @SafeRealloc(i8* %315, i32 %319, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 1035)
%321 = load i32, i32* @sgml.which
%322 = sext i32 %321 to i64
%323 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %322
store i8* %320, i8** %323
br label %340
324: ; preds = %305
%325 = load i32, i32* %10
%326 = load i32, i32* %9
%327 = add nsw i32 %325, %326
%328 = add nsw i32 %327, 256
%329 = call i8* @SafeMalloc(i32 %328, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 1037)
%330 = load i32, i32* @sgml.which
%331 = sext i32 %330 to i64
%332 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %331
store i8* %329, i8** %332
%333 = load i32, i32* @sgml.which
%334 = sext i32 %333 to i64
%335 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %334
%336 = load i8*, i8** %335
%337 = load i8*, i8** %11
%338 = load i32, i32* %8
%339 = call i32 @strncpy(i8* %336, i8* %337, i32 %338)
br label %340
340: ; preds = %324, %311
%341 = load i32, i32* @sgml.which
%342 = sext i32 %341 to i64
%343 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %342
%344 = load i8*, i8** %343
store i8* %344, i8** %11
%345 = load i32, i32* %10
%346 = add nsw i32 %345, 256
store i32 %346, i32* %10
br label %352
347: ; preds = %298
%348 = load i8*, i8** %11
%349 = load i32, i32* %8
%350 = sext i32 %349 to i64
%351 = getelementptr inbounds i8, i8* %348, i64 %350
store i8 0, i8* %351
br label %353
352: ; preds = %340
br label %45
353: ; preds = %347
br label %354
354: ; preds = %353, %39
%355 = load i8*, i8** %11
ret i8* %355
}

LLVM IR (-O2):
@sgml.safe = internal global [4 x [256 x i8]] zeroinitializer
@sgml.malloced = internal unnamed_addr global [4 x i8*] zeroinitializer
@sgml.which = internal unnamed_addr global i32 0
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/farhi/idl2matlab/refs/heads/master/cxref/sgml.c\00"
@.str.1 = [5 x i8] c"sgml\00"
@.str.2 = [6 x i8] c"&ero;\00"
@.str.3 = [8 x i8] c"&etago;\00"
@.str.4 = [5 x i8] c"&lt;\00"
@.str.5 = [5 x i8] c"&gt;\00"
@.str.6 = [7 x i8] c"&quot;\00"
@.str.7 = [6 x i8] c"&amp;\00"
@.str.8 = [9 x i8] c"&dollar;\00"
@.str.9 = [6 x i8] c"&num;\00"
@.str.10 = [9 x i8] c"&percnt;\00"
@.str.11 = [8 x i8] c"&tilde;\00"
@.str.12 = [10 x i8] c"<newline>\00"
define i8* @sgml(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%7 = load i32, i32* @sgml.which
%8 = add nsw i32 %7, 1
%9 = srem i32 %8, 4
store i32 %9, i32* @sgml.which
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [4 x [256 x i8]], [4 x [256 x i8]]* @sgml.safe, i64 0, i64 %10, i64 0
store i8 0, i8* %11
%12 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %10
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %20, label %15
15: ; preds = %2
%16 = tail call i32 @SafeFree(i8* %13, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 962)
%17 = load i32, i32* @sgml.which
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %18
store i8* null, i8** %19
br label %20
20: ; preds = %15, %2
%21 = icmp eq i8* %0, null
br i1 %21, label %199, label %22
22: ; preds = %20
%23 = call i32 @CopyOrSkip(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%24 = icmp eq i32 %1, 0
br label %25
25: ; preds = %193, %22
%26 = phi i32 [ 0, %22 ], [ %165, %193 ]
%27 = phi i32 [ %23, %22 ], [ %166, %193 ]
%28 = phi i32 [ 246, %22 ], [ %195, %193 ]
%29 = phi i8* [ %11, %22 ], [ %194, %193 ]
%30 = icmp slt i32 %26, %28
br i1 %30, label %31, label %164
31: ; preds = %25, %159
%32 = phi i32 [ %162, %159 ], [ %27, %25 ]
%33 = phi i32 [ %160, %159 ], [ %26, %25 ]
%34 = sext i32 %32 to i64
%35 = getelementptr inbounds i8, i8* %0, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i8 %36, 0
br i1 %38, label %164, label %39
39: ; preds = %31
%40 = load i32, i32* %3
%41 = icmp eq i32 %40, 0
br i1 %41, label %49, label %42
42: ; preds = %39
%43 = add nsw i32 %33, 1
%44 = sext i32 %33 to i64
%45 = getelementptr inbounds i8, i8* %29, i64 %44
store i8 %36, i8* %45
%46 = load i8, i8* %35
%47 = icmp eq i8 %46, 10
br i1 %47, label %48, label %159
48: ; preds = %42
store i32 0, i32* %3
br label %155
49: ; preds = %39
%50 = load i32, i32* %4
%51 = icmp eq i32 %50, 0
br i1 %51, label %55, label %52
52: ; preds = %49
%53 = icmp eq i8 %36, 10
br i1 %53, label %54, label %151
54: ; preds = %52
store i32 0, i32* %4
br label %151
55: ; preds = %49
br i1 %24, label %77, label %56
56: ; preds = %55
switch i32 %37, label %73 [
i32 38, label %57
i32 60, label %62
]
57: ; preds = %56
%58 = sext i32 %33 to i64
%59 = getelementptr inbounds i8, i8* %29, i64 %58
%60 = call i32 @strcpy(i8* %59, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%61 = add nsw i32 %33, 5
br label %151
62: ; preds = %56
%63 = add nsw i32 %32, 1
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %0, i64 %64
%66 = load i8, i8* %65
%67 = icmp eq i8 %66, 47
br i1 %67, label %68, label %73
68: ; preds = %62
%69 = sext i32 %33 to i64
%70 = getelementptr inbounds i8, i8* %29, i64 %69
%71 = call i32 @strcpy(i8* %70, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%72 = add nsw i32 %33, 7
br label %151
73: ; preds = %62, %56
%74 = add nsw i32 %33, 1
%75 = sext i32 %33 to i64
%76 = getelementptr inbounds i8, i8* %29, i64 %75
store i8 %36, i8* %76
br label %151
77: ; preds = %55
switch i32 %37, label %147 [
i32 60, label %78
i32 62, label %92
i32 34, label %97
i32 38, label %102
i32 36, label %107
i32 35, label %112
i32 37, label %117
i32 126, label %122
i32 10, label %127
]
78: ; preds = %77
%79 = add nsw i32 %32, 1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8, i8* %0, i64 %80
%82 = load i8, i8* %81
%83 = icmp eq i8 %82, 47
%84 = sext i32 %33 to i64
%85 = getelementptr inbounds i8, i8* %29, i64 %84
br i1 %83, label %86, label %89
86: ; preds = %78
%87 = call i32 @strcpy(i8* %85, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%88 = add nsw i32 %33, 7
br label %151
89: ; preds = %78
%90 = call i32 @strcpy(i8* %85, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%91 = add nsw i32 %33, 4
br label %151
92: ; preds = %77
%93 = sext i32 %33 to i64
%94 = getelementptr inbounds i8, i8* %29, i64 %93
%95 = call i32 @strcpy(i8* %94, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%96 = add nsw i32 %33, 4
br label %151
97: ; preds = %77
%98 = sext i32 %33 to i64
%99 = getelementptr inbounds i8, i8* %29, i64 %98
%100 = call i32 @strcpy(i8* %99, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%101 = add nsw i32 %33, 6
br label %151
102: ; preds = %77
%103 = sext i32 %33 to i64
%104 = getelementptr inbounds i8, i8* %29, i64 %103
%105 = call i32 @strcpy(i8* %104, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%106 = add nsw i32 %33, 5
br label %151
107: ; preds = %77
%108 = sext i32 %33 to i64
%109 = getelementptr inbounds i8, i8* %29, i64 %108
%110 = call i32 @strcpy(i8* %109, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%111 = add nsw i32 %33, 8
br label %151
112: ; preds = %77
%113 = sext i32 %33 to i64
%114 = getelementptr inbounds i8, i8* %29, i64 %113
%115 = call i32 @strcpy(i8* %114, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%116 = add nsw i32 %33, 5
br label %151
117: ; preds = %77
%118 = sext i32 %33 to i64
%119 = getelementptr inbounds i8, i8* %29, i64 %118
%120 = call i32 @strcpy(i8* %119, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%121 = add nsw i32 %33, 8
br label %151
122: ; preds = %77
%123 = sext i32 %33 to i64
%124 = getelementptr inbounds i8, i8* %29, i64 %123
%125 = call i32 @strcpy(i8* %124, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%126 = add nsw i32 %33, 7
br label %151
127: ; preds = %77
%128 = icmp eq i32 %33, 0
br i1 %128, label %141, label %129
129: ; preds = %127
%130 = add nsw i32 %33, -1
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i8, i8* %29, i64 %131
%133 = load i8, i8* %132
%134 = icmp eq i8 %133, 10
br i1 %134, label %135, label %141
135: ; preds = %129
%136 = sext i32 %33 to i64
%137 = getelementptr inbounds i8, i8* %29, i64 %136
%138 = call i32 @strcpy(i8* %137, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
%139 = add nsw i32 %33, 9
%140 = load i8, i8* %35
br label %141
141: ; preds = %135, %129, %127
%142 = phi i8 [ %140, %135 ], [ %36, %129 ], [ %36, %127 ]
%143 = phi i32 [ %139, %135 ], [ %33, %129 ], [ 0, %127 ]
%144 = add nsw i32 %143, 1
%145 = sext i32 %143 to i64
%146 = getelementptr inbounds i8, i8* %29, i64 %145
store i8 %142, i8* %146
br label %151
147: ; preds = %77
%148 = add nsw i32 %33, 1
%149 = sext i32 %33 to i64
%150 = getelementptr inbounds i8, i8* %29, i64 %149
store i8 %36, i8* %150
br label %151
151: ; preds = %54, %52, %92, %97, %102, %107, %112, %117, %122, %141, %147, %89, %86, %57, %68, %73
%152 = phi i32 [ %91, %89 ], [ %88, %86 ], [ %96, %92 ], [ %101, %97 ], [ %106, %102 ], [ %111, %107 ], [ %116, %112 ], [ %121, %117 ], [ %126, %122 ], [ %144, %141 ], [ %148, %147 ], [ %61, %57 ], [ %72, %68 ], [ %74, %73 ], [ %33, %52 ], [ %33, %54 ]
%153 = load i8, i8* %35
%154 = icmp eq i8 %153, 10
br i1 %154, label %155, label %159
155: ; preds = %48, %151
%156 = phi i32 [ %43, %48 ], [ %152, %151 ]
%157 = call i32 @CopyOrSkip(i8* %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%158 = add nsw i32 %157, %32
br label %159
159: ; preds = %42, %151, %155
%160 = phi i32 [ %156, %155 ], [ %152, %151 ], [ %43, %42 ]
%161 = phi i32 [ %158, %155 ], [ %32, %151 ], [ %32, %42 ]
%162 = add nsw i32 %161, 1
%163 = icmp slt i32 %160, %28
br i1 %163, label %31, label %164
164: ; preds = %31, %159, %25
%165 = phi i32 [ %26, %25 ], [ %160, %159 ], [ %33, %31 ]
%166 = phi i32 [ %27, %25 ], [ %162, %159 ], [ %32, %31 ]
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds i8, i8* %0, i64 %167
%169 = load i8, i8* %168
%170 = icmp eq i8 %169, 0
br i1 %170, label %196, label %171
171: ; preds = %164
%172 = load i32, i32* @sgml.which
%173 = zext i32 %172 to i64
%174 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %173
%175 = load i8*, i8** %174
%176 = icmp eq i8* %175, null
%177 = add nuw nsw i32 %28, 266
br i1 %176, label %183, label %178
178: ; preds = %171
%179 = call i8* @SafeRealloc(i8* %175, i32 %177, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 1035)
%180 = load i32, i32* @sgml.which
%181 = zext i32 %180 to i64
%182 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %181
store i8* %179, i8** %182
br label %193
183: ; preds = %171
%184 = call i8* @SafeMalloc(i32 %177, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 1037)
%185 = load i32, i32* @sgml.which
%186 = zext i32 %185 to i64
%187 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %186
store i8* %184, i8** %187
%188 = call i32 @strncpy(i8* %184, i8* %29, i32 %165)
%189 = load i32, i32* @sgml.which
%190 = zext i32 %189 to i64
%191 = getelementptr inbounds [4 x i8*], [4 x i8*]* @sgml.malloced, i64 0, i64 %190
%192 = load i8*, i8** %191
br label %193
193: ; preds = %183, %178
%194 = phi i8* [ %192, %183 ], [ %179, %178 ]
%195 = add nuw nsw i32 %28, 256
br label %25
196: ; preds = %164
%197 = sext i32 %165 to i64
%198 = getelementptr inbounds i8, i8* %29, i64 %197
store i8 0, i8* %198
br label %199
199: ; preds = %196, %20
%200 = phi i8* [ %29, %196 ], [ %11, %20 ]
ret i8* %200
}