#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 *html(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 = 7, 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/html.c",
             1500);
    malloced[which] = NULL;
  }
  if (c) {
    if (!verbatim)
      i = CopyOrSkip(c, "html", &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
          switch (c[i]) {
          case 12:
            break;
          case '<':
            strcpy(&ret[j], "&lt;");
            j += 4;
            break;
          case '>':
            strcpy(&ret[j], "&gt;");
            j += 4;
            break;
          case '&':
            strcpy(&ret[j], "&amp;");
            j += 5;
            break;
          case '\n':
            if (j && ret[j - 1] == '\n') {
              strcpy(&ret[j], "<br>");
              j += 4;
            }
            ret[j++] = c[i];
            break;
          default:
            ret[j++] = c[i];
          }
        if (c[i] == '\n')
          if (!verbatim)
            i += CopyOrSkip(c + i, "html", &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/html.c",
                          1547);
        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/html.c",
                         1549);
          strncpy(malloced[which], ret, (unsigned)j);
        }
        ret = malloced[which];
        len += 256;
      } else {
        ret[j] = 0;
        break;
      }
    }
  }
  return (ret);
}


x86 assembly (clang, -O0):
<html>:
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   $0x7,-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 <html+0xd7>
movslq 0x327b(%rip),%rcx
lea    0x3254(%rip),%rax
mov    (%rax,%rcx,8),%rdi
lea    0xde9(%rip),%rsi
mov    $0x5dc,%edx
call   1070 <SafeFree@plt>
movslq 0x3258(%rip),%rcx
lea    0x3231(%rip),%rax
movq   $0x0,(%rax,%rcx,8)
cmpq   $0x0,-0x8(%rbp)
je     15e6 <html+0x486>
cmpl   $0x0,-0xc(%rbp)
jne    1267 <html+0x107>
mov    -0x8(%rbp),%rdi
lea    0xe33(%rip),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1080 <CopyOrSkip@plt>
mov    %eax,-0x18(%rbp)
jmp    126c <html+0x10c>
jmp    1271 <html+0x111>
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x24(%rbp),%ecx
mov    %al,-0x31(%rbp)
jge    1297 <html+0x137>
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    12a7 <html+0x147>
jmp    14e1 <html+0x381>
cmpl   $0x0,-0x10(%rbp)
je     12f2 <html+0x192>
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    12ed <html+0x18d>
movl   $0x0,-0x10(%rbp)
jmp    1485 <html+0x325>
cmpl   $0x0,-0x14(%rbp)
je     131d <html+0x1bd>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1318 <html+0x1b8>
movl   $0x0,-0x14(%rbp)
jmp    1480 <html+0x320>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x38(%rbp)
sub    $0xa,%eax
je     13f2 <html+0x292>
jmp    133a <html+0x1da>
mov    -0x38(%rbp),%eax
sub    $0xc,%eax
je     137e <html+0x21e>
jmp    134b <html+0x1eb>
mov    -0x38(%rbp),%eax
sub    $0x26,%eax
je     13cd <html+0x26d>
jmp    135c <html+0x1fc>
mov    -0x38(%rbp),%eax
sub    $0x3c,%eax
je     1383 <html+0x223>
jmp    136d <html+0x20d>
mov    -0x38(%rbp),%eax
sub    $0x3e,%eax
je     13a8 <html+0x248>
jmp    145b <html+0x2fb>
jmp    147b <html+0x31b>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xcfa(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x1c(%rbp)
jmp    147b <html+0x31b>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xcda(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x1c(%rbp)
jmp    147b <html+0x31b>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xcba(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x1c(%rbp)
jmp    147b <html+0x31b>
cmpl   $0x0,-0x1c(%rbp)
je     1436 <html+0x2d6>
mov    -0x30(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1436 <html+0x2d6>
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
lea    0xc77(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x1c(%rbp),%eax
add    $0x4,%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    147b <html+0x31b>
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    1480 <html+0x320>
jmp    1485 <html+0x325>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    14ce <html+0x36e>
cmpl   $0x0,-0xc(%rbp)
jne    14c9 <html+0x369>
mov    -0x8(%rbp),%rdi
movslq -0x18(%rbp),%rax
add    %rax,%rdi
lea    0xbd4(%rip),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1080 <CopyOrSkip@plt>
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    14ce <html+0x36e>
jmp    14d3 <html+0x373>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1271 <html+0x111>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     15cb <html+0x46b>
movslq 0x2f86(%rip),%rcx
lea    0x2f5f(%rip),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     1555 <html+0x3f5>
movslq 0x2f6d(%rip),%rcx
lea    0x2f46(%rip),%rax
mov    (%rax,%rcx,8),%rdi
mov    -0x24(%rbp),%esi
add    -0x20(%rbp),%esi
add    $0x100,%esi
lea    0xacf(%rip),%rdx
mov    $0x60b,%ecx
call   1050 <SafeRealloc@plt>
mov    %rax,%rdx
movslq 0x2f3b(%rip),%rcx
lea    0x2f14(%rip),%rax
mov    %rdx,(%rax,%rcx,8)
jmp    15a5 <html+0x445>
mov    -0x24(%rbp),%edi
add    -0x20(%rbp),%edi
add    $0x100,%edi
lea    0xa98(%rip),%rsi
mov    $0x60d,%edx
call   1060 <SafeMalloc@plt>
mov    %rax,%rdx
movslq 0x2f04(%rip),%rcx
lea    0x2edd(%rip),%rax
mov    %rdx,(%rax,%rcx,8)
movslq 0x2ef2(%rip),%rcx
lea    0x2ecb(%rip),%rax
mov    (%rax,%rcx,8),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncpy@plt>
movslq 0x2ed4(%rip),%rcx
lea    0x2ead(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
add    $0x100,%eax
mov    %eax,-0x24(%rbp)
jmp    15dc <html+0x47c>
mov    -0x30(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    15e1 <html+0x481>
jmp    126c <html+0x10c>
jmp    15e6 <html+0x486>
mov    -0x30(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,0x14(%rsp)
mov    %rdi,%r12
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),%ebx
add    $0x1,%ebx
mov    %ebx,0x32d9(%rip)
lea    0x32b2(%rip),%rbp
mov    0x0(%rbp,%rbx,8),%rdi
shl    $0x8,%rbx
lea    0x2ea2(%rip),%r15
movb   $0x0,(%rbx,%r15,1)
test   %rdi,%rdi
je     11e8 <html+0x88>
lea    0xe31(%rip),%rsi
mov    $0x5dc,%edx
call   1070 <SafeFree@plt>
mov    0x32a1(%rip),%eax
movq   $0x0,0x0(%rbp,%rax,8)
add    %rbx,%r15
test   %r12,%r12
je     143e <html+0x2de>
xor    %ebp,%ebp
mov    $0x0,%ebx
cmpl   $0x0,0x14(%rsp)
jne    121d <html+0xbd>
lea    0xe81(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %r12,%rdi
call   1080 <CopyOrSkip@plt>
mov    %eax,%ebx
mov    $0xf9,%r14d
jmp    1233 <html+0xd3>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
cmp    %r14d,%ebp
jge    12da <html+0x17a>
movslq %ebx,%r13
movsbl (%r12,%r13,1),%eax
test   %eax,%eax
je     12da <html+0x17a>
add    %r12,%r13
cmpl   $0x0,0x10(%rsp)
je     1280 <html+0x120>
movslq %ebp,%rcx
add    $0x1,%ebp
mov    %al,(%r15,%rcx,1)
cmpb   $0xa,0x0(%r13)
jne    13c0 <html+0x260>
movl   $0x0,0x10(%rsp)
cmpl   $0x0,0x14(%rsp)
je     13cb <html+0x26b>
jmp    1230 <html+0xd0>
cmpl   $0x0,0xc(%rsp)
je     12a4 <html+0x144>
cmp    $0xa,%al
jne    13c0 <html+0x260>
movl   $0x0,0xc(%rsp)
cmpl   $0x0,0x14(%rsp)
je     13cb <html+0x26b>
jmp    1230 <html+0xd0>
cmp    $0x25,%eax
jle    1331 <html+0x1d1>
cmp    $0x26,%eax
je     138a <html+0x22a>
cmp    $0x3e,%eax
je     13ab <html+0x24b>
cmp    $0x3c,%eax
jne    1420 <html+0x2c0>
movslq %ebp,%rdi
add    %r15,%rdi
lea    0xdba(%rip),%rsi
jmp    13b8 <html+0x258>
movslq %ebx,%rax
cmpb   $0x0,(%r12,%rax,1)
je     1436 <html+0x2d6>
mov    0x3192(%rip),%eax
lea    0x316b(%rip),%r13
mov    0x0(%r13,%rax,8),%rdi
lea    0x107(%r14),%esi
test   %rdi,%rdi
je     1348 <html+0x1e8>
lea    0xcf3(%rip),%rdx
mov    $0x60b,%ecx
call   1050 <SafeRealloc@plt>
mov    %rax,%r15
mov    0x3160(%rip),%eax
mov    %r15,0x0(%r13,%rax,8)
add    $0x100,%r14d
jmp    1233 <html+0xd3>
cmp    $0xa,%eax
je     13f6 <html+0x296>
cmp    $0xc,%eax
je     13c0 <html+0x260>
jmp    1420 <html+0x2c0>
mov    %esi,%edi
lea    0xcaf(%rip),%rsi
mov    $0x60d,%edx
call   1060 <SafeMalloc@plt>
mov    0x311f(%rip),%ecx
mov    %rax,0x0(%r13,%rcx,8)
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1030 <strncpy@plt>
mov    0x3107(%rip),%eax
mov    0x0(%r13,%rax,8),%r15
add    $0x100,%r14d
jmp    1233 <html+0xd3>
movslq %ebp,%rdi
add    %r15,%rdi
lea    0xd02(%rip),%rsi
call   1040 <strcpy@plt>
add    $0x5,%ebp
cmpl   $0x0,0x14(%rsp)
je     13cb <html+0x26b>
jmp    1230 <html+0xd0>
movslq %ebp,%rdi
add    %r15,%rdi
lea    0xcdc(%rip),%rsi
call   1040 <strcpy@plt>
add    $0x4,%ebp
cmpl   $0x0,0x14(%rsp)
jne    1230 <html+0xd0>
cmpb   $0xa,0x0(%r13)
jne    1230 <html+0xd0>
mov    %r13,%rdi
lea    0xcaa(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1080 <CopyOrSkip@plt>
add    %eax,%ebx
jmp    1230 <html+0xd0>
test   %ebp,%ebp
je     141e <html+0x2be>
movslq %ebp,%rdi
cmpb   $0xa,-0x1(%rdi,%r15,1)
jne    1420 <html+0x2c0>
add    %r15,%rdi
lea    0xc90(%rip),%rsi
call   1040 <strcpy@plt>
add    $0x4,%ebp
movzbl 0x0(%r13),%eax
jmp    1420 <html+0x2c0>
xor    %ebp,%ebp
movslq %ebp,%rcx
add    $0x1,%ebp
mov    %al,(%r15,%rcx,1)
cmpl   $0x0,0x14(%rsp)
je     13cb <html+0x26b>
jmp    1230 <html+0xd0>
movslq %ebp,%rax
movb   $0x0,(%r15,%rax,1)
mov    %r15,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@html.safe = internal global [4 x [256 x i8]] zeroinitializer
@html.malloced = internal global [4 x i8*] zeroinitializer
@html.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/html.c\00"
@.str.1 = [5 x i8] c"html\00"
@.str.2 = [5 x i8] c"&lt;\00"
@.str.3 = [5 x i8] c"&gt;\00"
@.str.4 = [6 x i8] c"&amp;\00"
@.str.5 = [5 x i8] c"<br>\00"
define i8* @html(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 7, i32* %9
%12 = load i32, i32* %9
%13 = sub nsw i32 256, %12
store i32 %13, i32* %10
%14 = load i32, i32* @html.which
%15 = add nsw i32 %14, 1
%16 = srem i32 %15, 4
store i32 %16, i32* @html.which
%17 = load i32, i32* @html.which
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [4 x [256 x i8]], [4 x [256 x i8]]* @html.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* @html.which
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [4 x [256 x i8]], [4 x [256 x i8]]* @html.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* @html.which
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.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* @html.which
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.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 1500)
%36 = load i32, i32* @html.which
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.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 %256
42: ; preds = %39
%43 = load i32, i32* %4
%44 = icmp ne i32 %43, 0
br i1 %44, label %48, label %45
45: ; preds = %42
%46 = load i8*, i8** %3
%47 = call i32 @CopyOrSkip(i8* %46, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6)
store i32 %47, i32* %7
br label %48
48: ; preds = %45, %42
br label %49
49: ; preds = %48, %254
br label %50
50: ; preds = %197, %49
%51 = load i32, i32* %8
%52 = load i32, i32* %10
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %62
54: ; preds = %50
%55 = load i8*, i8** %3
%56 = load i32, i32* %7
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %55, i64 %57
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp ne i32 %60, 0
br label %62
62: ; preds = %54, %50
%63 = phi i1 [ false, %50 ], [ %61, %54 ]
br i1 %63, label %64, label %200
64: ; preds = %62
%65 = load i32, i32* %5
%66 = icmp ne i32 %65, 0
br i1 %66, label %67, label %87
67: ; preds = %64
%68 = load i8*, i8** %3
%69 = load i32, i32* %7
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
%72 = load i8, i8* %71
%73 = load i8*, i8** %11
%74 = load i32, i32* %8
%75 = add nsw i32 %74, 1
store i32 %75, i32* %8
%76 = sext i32 %74 to i64
%77 = getelementptr inbounds i8, i8* %73, i64 %76
store i8 %72, i8* %77
%78 = load i8*, i8** %3
%79 = load i32, i32* %7
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8, i8* %78, i64 %80
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 10
br i1 %84, label %85, label %86
85: ; preds = %67
store i32 0, i32* %5
br label %86
86: ; preds = %85, %67
br label %176
87: ; preds = %64
%88 = load i32, i32* %6
%89 = icmp ne i32 %88, 0
br i1 %89, label %90, label %100
90: ; preds = %87
%91 = load i8*, i8** %3
%92 = load i32, i32* %7
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %91, i64 %93
%95 = load i8, i8* %94
%96 = sext i8 %95 to i32
%97 = icmp eq i32 %96, 10
br i1 %97, label %98, label %99
98: ; preds = %90
store i32 0, i32* %6
br label %99
99: ; preds = %98, %90
br label %175
100: ; preds = %87
%101 = load i8*, i8** %3
%102 = load i32, i32* %7
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %101, i64 %103
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
switch i32 %106, label %163 [
i32 12, label %107
i32 60, label %108
i32 62, label %116
i32 38, label %124
i32 10, label %132
]
107: ; preds = %100
br label %174
108: ; preds = %100
%109 = load i8*, i8** %11
%110 = load i32, i32* %8
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i8, i8* %109, i64 %111
%113 = call i32 @strcpy(i8* %112, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%114 = load i32, i32* %8
%115 = add nsw i32 %114, 4
store i32 %115, i32* %8
br label %174
116: ; preds = %100
%117 = load i8*, i8** %11
%118 = load i32, i32* %8
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i8, i8* %117, i64 %119
%121 = call i32 @strcpy(i8* %120, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%122 = load i32, i32* %8
%123 = add nsw i32 %122, 4
store i32 %123, i32* %8
br label %174
124: ; preds = %100
%125 = load i8*, i8** %11
%126 = load i32, i32* %8
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i8, i8* %125, i64 %127
%129 = call i32 @strcpy(i8* %128, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%130 = load i32, i32* %8
%131 = add nsw i32 %130, 5
store i32 %131, i32* %8
br label %174
132: ; preds = %100
%133 = load i32, i32* %8
%134 = icmp ne i32 %133, 0
br i1 %134, label %135, label %152
135: ; preds = %132
%136 = load i8*, i8** %11
%137 = load i32, i32* %8
%138 = sub nsw i32 %137, 1
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i8, i8* %136, i64 %139
%141 = load i8, i8* %140
%142 = sext i8 %141 to i32
%143 = icmp eq i32 %142, 10
br i1 %143, label %144, label %152
144: ; preds = %135
%145 = load i8*, i8** %11
%146 = load i32, i32* %8
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i8, i8* %145, i64 %147
%149 = call i32 @strcpy(i8* %148, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%150 = load i32, i32* %8
%151 = add nsw i32 %150, 4
store i32 %151, i32* %8
br label %152
152: ; preds = %144, %135, %132
%153 = load i8*, i8** %3
%154 = load i32, i32* %7
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i8, i8* %153, i64 %155
%157 = load i8, i8* %156
%158 = load i8*, i8** %11
%159 = load i32, i32* %8
%160 = add nsw i32 %159, 1
store i32 %160, i32* %8
%161 = sext i32 %159 to i64
%162 = getelementptr inbounds i8, i8* %158, i64 %161
store i8 %157, i8* %162
br label %174
163: ; preds = %100
%164 = load i8*, i8** %3
%165 = load i32, i32* %7
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds i8, i8* %164, i64 %166
%168 = load i8, i8* %167
%169 = load i8*, i8** %11
%170 = load i32, i32* %8
%171 = add nsw i32 %170, 1
store i32 %171, i32* %8
%172 = sext i32 %170 to i64
%173 = getelementptr inbounds i8, i8* %169, i64 %172
store i8 %168, i8* %173
br label %174
174: ; preds = %163, %152, %124, %116, %108, %107
br label %175
175: ; preds = %174, %99
br label %176
176: ; preds = %175, %86
%177 = load i8*, i8** %3
%178 = load i32, i32* %7
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds i8, i8* %177, i64 %179
%181 = load i8, i8* %180
%182 = sext i8 %181 to i32
%183 = icmp eq i32 %182, 10
br i1 %183, label %184, label %196
184: ; preds = %176
%185 = load i32, i32* %4
%186 = icmp ne i32 %185, 0
br i1 %186, label %195, label %187
187: ; preds = %184
%188 = load i8*, i8** %3
%189 = load i32, i32* %7
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds i8, i8* %188, i64 %190
%192 = call i32 @CopyOrSkip(i8* %191, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6)
%193 = load i32, i32* %7
%194 = add nsw i32 %193, %192
store i32 %194, i32* %7
br label %195
195: ; preds = %187, %184
br label %196
196: ; preds = %195, %176
br label %197
197: ; preds = %196
%198 = load i32, i32* %7
%199 = add nsw i32 %198, 1
store i32 %199, i32* %7
br label %50
200: ; preds = %62
%201 = load i8*, i8** %3
%202 = load i32, i32* %7
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds i8, i8* %201, i64 %203
%205 = load i8, i8* %204
%206 = icmp ne i8 %205, 0
br i1 %206, label %207, label %249
207: ; preds = %200
%208 = load i32, i32* @html.which
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.malloced, i64 0, i64 %209
%211 = load i8*, i8** %210
%212 = icmp ne i8* %211, null
br i1 %212, label %213, label %226
213: ; preds = %207
%214 = load i32, i32* @html.which
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.malloced, i64 0, i64 %215
%217 = load i8*, i8** %216
%218 = load i32, i32* %10
%219 = load i32, i32* %9
%220 = add nsw i32 %218, %219
%221 = add nsw i32 %220, 256
%222 = call i8* @SafeRealloc(i8* %217, i32 %221, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 1547)
%223 = load i32, i32* @html.which
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.malloced, i64 0, i64 %224
store i8* %222, i8** %225
br label %242
226: ; preds = %207
%227 = load i32, i32* %10
%228 = load i32, i32* %9
%229 = add nsw i32 %227, %228
%230 = add nsw i32 %229, 256
%231 = call i8* @SafeMalloc(i32 %230, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 1549)
%232 = load i32, i32* @html.which
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.malloced, i64 0, i64 %233
store i8* %231, i8** %234
%235 = load i32, i32* @html.which
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.malloced, i64 0, i64 %236
%238 = load i8*, i8** %237
%239 = load i8*, i8** %11
%240 = load i32, i32* %8
%241 = call i32 @strncpy(i8* %238, i8* %239, i32 %240)
br label %242
242: ; preds = %226, %213
%243 = load i32, i32* @html.which
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.malloced, i64 0, i64 %244
%246 = load i8*, i8** %245
store i8* %246, i8** %11
%247 = load i32, i32* %10
%248 = add nsw i32 %247, 256
store i32 %248, i32* %10
br label %254
249: ; preds = %200
%250 = load i8*, i8** %11
%251 = load i32, i32* %8
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds i8, i8* %250, i64 %252
store i8 0, i8* %253
br label %255
254: ; preds = %242
br label %49
255: ; preds = %249
br label %256
256: ; preds = %255, %39
%257 = load i8*, i8** %11
ret i8* %257
}

LLVM IR (-O2):
@html.safe = internal global [4 x [256 x i8]] zeroinitializer
@html.malloced = internal unnamed_addr global [4 x i8*] zeroinitializer
@html.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/html.c\00"
@.str.1 = [5 x i8] c"html\00"
@.str.2 = [5 x i8] c"&lt;\00"
@.str.3 = [5 x i8] c"&gt;\00"
@.str.4 = [6 x i8] c"&amp;\00"
@.str.5 = [5 x i8] c"<br>\00"
define i8* @html(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* @html.which
%8 = add nsw i32 %7, 1
%9 = srem i32 %8, 4
store i32 %9, i32* @html.which
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [4 x [256 x i8]], [4 x [256 x i8]]* @html.safe, i64 0, i64 %10, i64 0
store i8 0, i8* %11
%12 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.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 1500)
%17 = load i32, i32* @html.which
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.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 %145, label %22
22: ; preds = %20
%23 = icmp ne i32 %1, 0
br i1 %23, label %26, label %24
24: ; preds = %22
%25 = call i32 @CopyOrSkip(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ 0, %22 ], [ %25, %24 ]
br label %28
28: ; preds = %26, %139
%29 = phi i32 [ %111, %139 ], [ 0, %26 ]
%30 = phi i32 [ %112, %139 ], [ %27, %26 ]
%31 = phi i32 [ %141, %139 ], [ 249, %26 ]
%32 = phi i8* [ %140, %139 ], [ %11, %26 ]
%33 = icmp slt i32 %29, %31
br i1 %33, label %34, label %110
34: ; preds = %28, %106
%35 = phi i32 [ %108, %106 ], [ %30, %28 ]
%36 = phi i32 [ %99, %106 ], [ %29, %28 ]
%37 = sext i32 %35 to i64
%38 = getelementptr inbounds i8, i8* %0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i8 %39, 0
br i1 %41, label %110, label %42
42: ; preds = %34
%43 = load i32, i32* %3
%44 = icmp eq i32 %43, 0
br i1 %44, label %52, label %45
45: ; preds = %42
%46 = add nsw i32 %36, 1
%47 = sext i32 %36 to i64
%48 = getelementptr inbounds i8, i8* %32, i64 %47
store i8 %39, i8* %48
%49 = load i8, i8* %38
%50 = icmp eq i8 %49, 10
br i1 %50, label %51, label %98
51: ; preds = %45
store i32 0, i32* %3
br label %98
52: ; preds = %42
%53 = load i32, i32* %4
%54 = icmp eq i32 %53, 0
br i1 %54, label %58, label %55
55: ; preds = %52
%56 = icmp eq i8 %39, 10
br i1 %56, label %57, label %98
57: ; preds = %55
store i32 0, i32* %4
br label %98
58: ; preds = %52
switch i32 %40, label %94 [
i32 12, label %98
i32 60, label %59
i32 62, label %64
i32 38, label %69
i32 10, label %74
]
59: ; preds = %58
%60 = sext i32 %36 to i64
%61 = getelementptr inbounds i8, i8* %32, i64 %60
%62 = call i32 @strcpy(i8* %61, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%63 = add nsw i32 %36, 4
br label %98
64: ; preds = %58
%65 = sext i32 %36 to i64
%66 = getelementptr inbounds i8, i8* %32, i64 %65
%67 = call i32 @strcpy(i8* %66, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%68 = add nsw i32 %36, 4
br label %98
69: ; preds = %58
%70 = sext i32 %36 to i64
%71 = getelementptr inbounds i8, i8* %32, i64 %70
%72 = call i32 @strcpy(i8* %71, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%73 = add nsw i32 %36, 5
br label %98
74: ; preds = %58
%75 = icmp eq i32 %36, 0
br i1 %75, label %88, label %76
76: ; preds = %74
%77 = add nsw i32 %36, -1
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8, i8* %32, i64 %78
%80 = load i8, i8* %79
%81 = icmp eq i8 %80, 10
br i1 %81, label %82, label %88
82: ; preds = %76
%83 = sext i32 %36 to i64
%84 = getelementptr inbounds i8, i8* %32, i64 %83
%85 = call i32 @strcpy(i8* %84, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%86 = add nsw i32 %36, 4
%87 = load i8, i8* %38
br label %88
88: ; preds = %82, %76, %74
%89 = phi i8 [ %87, %82 ], [ %39, %76 ], [ %39, %74 ]
%90 = phi i32 [ %86, %82 ], [ %36, %76 ], [ 0, %74 ]
%91 = add nsw i32 %90, 1
%92 = sext i32 %90 to i64
%93 = getelementptr inbounds i8, i8* %32, i64 %92
store i8 %89, i8* %93
br label %98
94: ; preds = %58
%95 = add nsw i32 %36, 1
%96 = sext i32 %36 to i64
%97 = getelementptr inbounds i8, i8* %32, i64 %96
store i8 %39, i8* %97
br label %98
98: ; preds = %57, %55, %94, %88, %69, %64, %59, %58, %45, %51
%99 = phi i32 [ %46, %51 ], [ %46, %45 ], [ %36, %57 ], [ %36, %55 ], [ %95, %94 ], [ %91, %88 ], [ %73, %69 ], [ %68, %64 ], [ %63, %59 ], [ %36, %58 ]
%100 = load i8, i8* %38
%101 = icmp ne i8 %100, 10
%102 = or i1 %23, %101
br i1 %102, label %106, label %103
103: ; preds = %98
%104 = call i32 @CopyOrSkip(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%105 = add nsw i32 %104, %35
br label %106
106: ; preds = %98, %103
%107 = phi i32 [ %35, %98 ], [ %105, %103 ]
%108 = add nsw i32 %107, 1
%109 = icmp slt i32 %99, %31
br i1 %109, label %34, label %110
110: ; preds = %34, %106, %28
%111 = phi i32 [ %29, %28 ], [ %99, %106 ], [ %36, %34 ]
%112 = phi i32 [ %30, %28 ], [ %108, %106 ], [ %35, %34 ]
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8, i8* %0, i64 %113
%115 = load i8, i8* %114
%116 = icmp eq i8 %115, 0
br i1 %116, label %142, label %117
117: ; preds = %110
%118 = load i32, i32* @html.which
%119 = zext i32 %118 to i64
%120 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.malloced, i64 0, i64 %119
%121 = load i8*, i8** %120
%122 = icmp eq i8* %121, null
%123 = add nuw nsw i32 %31, 263
br i1 %122, label %129, label %124
124: ; preds = %117
%125 = call i8* @SafeRealloc(i8* %121, i32 %123, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 1547)
%126 = load i32, i32* @html.which
%127 = zext i32 %126 to i64
%128 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.malloced, i64 0, i64 %127
store i8* %125, i8** %128
br label %139
129: ; preds = %117
%130 = call i8* @SafeMalloc(i32 %123, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 1549)
%131 = load i32, i32* @html.which
%132 = zext i32 %131 to i64
%133 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.malloced, i64 0, i64 %132
store i8* %130, i8** %133
%134 = call i32 @strncpy(i8* %130, i8* %32, i32 %111)
%135 = load i32, i32* @html.which
%136 = zext i32 %135 to i64
%137 = getelementptr inbounds [4 x i8*], [4 x i8*]* @html.malloced, i64 0, i64 %136
%138 = load i8*, i8** %137
br label %139
139: ; preds = %129, %124
%140 = phi i8* [ %138, %129 ], [ %125, %124 ]
%141 = add nuw nsw i32 %31, 256
br label %28
142: ; preds = %110
%143 = sext i32 %111 to i64
%144 = getelementptr inbounds i8, i8* %32, i64 %143
store i8 0, i8* %144
br label %145
145: ; preds = %142, %20
%146 = phi i8* [ %32, %142 ], [ %11, %20 ]
ret i8* %146
}