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

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ tagfilters_remove_prefix;
typedef int /*<<< orphan*/ tagfilters;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int getZVMLogLevel();
scalar_t__ malloc(int);
char *myrealloc(char *, size_t *);
int /*<<< orphan*/ printf(char *, char *, int, char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, ...);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strstr(char *, char const *);
char *generateJson(char **environ) {
  size_t jsonmaxsize = 1024;
  size_t jsonsize = 0;
  int keycount = 0;
  char *json = (char *)malloc(sizeof(char) * jsonmaxsize);
  const char *tagfilters[] = {"CONTENT_LENGTH", "CONTENT_TYPE",
                              "HTTP_X_OBJECT_META", "HTTP_X_TIMESTAMP",
                              "PATH_INFO"};
  const char *tagfilters_remove_prefix[] = {"HTTP_X_OBJECT_META_", "HTTP_X_"};
  int tagfilterscount = sizeof(tagfilters) / sizeof(char *);
  int tagfilters_remove_prefix_count =
      sizeof(tagfilters_remove_prefix) / sizeof(char *);
  sprintf(json, "{\n");
  jsonsize = strlen(json) - 1;
  int i;
  for (i = 0; environ[i] != NULL; i++) {
    int envsize = strlen(environ[i]);
    char *pKey = (char *)malloc(envsize * sizeof(char));
    char *pVal = (char *)malloc(envsize * sizeof(char));
    char *pEq;
    int eqPos = 0;
    if ((pEq = strstr(environ[i], "=")) != NULL)
      eqPos = pEq - environ[i];
    if (eqPos == 0) {
      free(pKey);
      free(pVal);
      continue;
    }
    strncpy(pKey, environ[i], eqPos);
    strncpy(pVal, environ[i] + eqPos + 1, envsize - eqPos);
    pKey[eqPos] = '\0';
    char *pFilterOK;
    int iFind = 0;
    int iFindTrim = 0;
    int j = 0;
    for (j = 0; j < tagfilterscount; j++) {
      if ((pFilterOK = strstr(pKey, tagfilters[j])) != NULL) {
        iFind = 1;
      }
    }
    if (iFind == 0) {
      continue;
    }
    for (j = 0; j < tagfilters_remove_prefix_count; j++) {
      if ((pFilterOK = strstr(pKey, tagfilters_remove_prefix[j])) != NULL) {
        char *pKeyTrim = (char *)malloc(sizeof(char) * strlen(pKey));
        strncpy(pKeyTrim, pKey + strlen(tagfilters_remove_prefix[j]),
                strlen(pKey) - strlen(tagfilters_remove_prefix[j]) + 1);
        size_t addsize = strlen(pKeyTrim) + strlen(pVal) + 8;
        if ((jsonsize + addsize) > jsonmaxsize)
          json = myrealloc(json, &jsonmaxsize);
        sprintf(json + jsonsize + 1, "\t\"%s\":\"%s\",\n", pKeyTrim, pVal);
        char pKeyVal[strlen(pKey) + strlen(pVal) + 2];
        sprintf(pKeyVal, "%s:%s", pKey, pVal);
        if (getZVMLogLevel() >= 3) {
          printf("%s [LogLevel=%d] [%s], \t%"
                 "s"
                 " \n",
                 "***ZVMLog", 3, "remove prefix key",
                 tagfilters_remove_prefix[j]);
        };
        if (getZVMLogLevel() >= 3) {
          printf("%s [LogLevel=%d] [%s], \t%"
                 "s"
                 " \n",
                 "***ZVMLog", 3, "Key:Val", pKeyVal);
        };
        jsonsize += addsize;
        free(pKeyTrim);
        keycount++;
        iFindTrim = 1;
        break;
      }
    }
    if (iFindTrim == 0) {
      size_t addsize = strlen(pKey) + strlen(pVal) + 8;
      if ((jsonsize + addsize) > jsonmaxsize)
        json = myrealloc(json, &jsonmaxsize);
      sprintf(json + jsonsize + 1, "\t\"%s\":\"%s\",\n", pKey, pVal);
      jsonsize += addsize;
    }
    free(pKey);
    free(pVal);
  }
  if (jsonsize + 2 > jsonmaxsize)
    json = myrealloc(json, &jsonmaxsize);
  sprintf(json + jsonsize - 1, "\n}");
  jsonsize += 2;
  if (getZVMLogLevel() >= 1) {
    printf("%s [LogLevel=%d] [%s], \t%"
           "d"
           " \n",
           "***ZVMLog", 1, "json key count", keycount);
  };
  return json;
}


x86 assembly (clang, -O0):
<generateJson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x400,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x28(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1070 <memset@plt>
lea    0xe10(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe14(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe16(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe1e(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe24(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2be9(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0x2be6(%rip),%rax
mov    %rax,-0x58(%rbp)
movl   $0x5,-0x64(%rbp)
movl   $0x2,-0x68(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe17(%rip),%rsi
mov    $0x0,%al
call   10a0 <sprintf@plt>
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x6c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1755 <generateJson+0x5b5>
mov    -0x8(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x70(%rbp)
movslq -0x70(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x78(%rbp)
movslq -0x70(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x80(%rbp)
movl   $0x0,-0x8c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd90(%rip),%rsi
call   10c0 <strstr@plt>
mov    %rax,-0x88(%rbp)
cmp    $0x0,%rax
je     130b <generateJson+0x16b>
mov    -0x88(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x6c(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
sub    %rcx,%rax
mov    %eax,-0x8c(%rbp)
cmpl   $0x0,-0x8c(%rbp)
jne    132f <generateJson+0x18f>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
jmp    1747 <generateJson+0x5a7>
mov    -0x78(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x8c(%rbp),%edx
call   1040 <strncpy@plt>
mov    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x6c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
movslq -0x8c(%rbp),%rax
add    %rax,%rsi
add    $0x1,%rsi
mov    -0x70(%rbp),%edx
sub    -0x8c(%rbp),%edx
call   1040 <strncpy@plt>
mov    -0x78(%rbp),%rax
movslq -0x8c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x9c(%rbp)
movl   $0x0,-0xa0(%rbp)
movl   $0x0,-0xa4(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    1405 <generateJson+0x265>
mov    -0x78(%rbp),%rdi
movslq -0xa4(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rsi
call   10c0 <strstr@plt>
mov    %rax,-0x98(%rbp)
cmp    $0x0,%rax
je     13ec <generateJson+0x24c>
movl   $0x1,-0x9c(%rbp)
jmp    13f1 <generateJson+0x251>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    13ad <generateJson+0x20d>
cmpl   $0x0,-0x9c(%rbp)
jne    1417 <generateJson+0x277>
jmp    1747 <generateJson+0x5a7>
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x68(%rbp),%eax
jge    16a3 <generateJson+0x503>
mov    -0x78(%rbp),%rdi
movslq -0xa4(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rsi
call   10c0 <strstr@plt>
mov    %rax,-0x98(%rbp)
cmp    $0x0,%rax
je     168a <generateJson+0x4ea>
mov    -0x78(%rbp),%rdi
call   1050 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0xb0(%rbp)
mov    -0xb0(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0x78(%rbp),%rax
mov    %rax,-0xf8(%rbp)
movslq -0xa4(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0xf8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0xe0(%rbp)
mov    -0x78(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0xec(%rbp)
movslq -0xa4(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rdi
call   1050 <strlen@plt>
mov    -0xec(%rbp),%edx
mov    -0xe8(%rbp),%rdi
mov    -0xe0(%rbp),%rsi
sub    %eax,%edx
add    $0x1,%edx
call   1040 <strncpy@plt>
mov    -0xb0(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0xd4(%rbp)
mov    -0x80(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0xd4(%rbp),%eax
add    %ecx,%eax
add    $0x8,%eax
cltq
mov    %rax,-0xb8(%rbp)
mov    -0x18(%rbp),%rax
add    -0xb8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1548 <generateJson+0x3a8>
mov    -0x28(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <myrealloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
lea    0x1(%rax,%rcx,1),%rdi
mov    -0xb0(%rbp),%rdx
mov    -0x80(%rbp),%rcx
lea    0xb04(%rip),%rsi
xor    %eax,%eax
call   10a0 <sprintf@plt>
mov    -0x78(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x104(%rbp)
mov    -0x80(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x104(%rbp),%ecx
mov    %eax,%edx
mov    %ecx,%eax
mov    %edx,%ecx
lea    0x2(%rax,%rcx,1),%eax
mov    %rsp,%rcx
mov    %rcx,-0xc0(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x100(%rbp)
mov    %rdi,%rsp
mov    %rax,-0xc8(%rbp)
mov    -0x78(%rbp),%rdx
mov    -0x80(%rbp),%rcx
lea    0xaa7(%rip),%rsi
mov    $0x0,%al
call   10a0 <sprintf@plt>
mov    $0x0,%al
call   10b0 <getZVMLogLevel@plt>
cmp    $0x3,%eax
jl     1615 <generateJson+0x475>
movslq -0xa4(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%r8
lea    0xa83(%rip),%rdi
lea    0xa99(%rip),%rsi
mov    $0x3,%edx
lea    0xa97(%rip),%rcx
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   10b0 <getZVMLogLevel@plt>
cmp    $0x3,%eax
jl     164d <generateJson+0x4ad>
mov    -0x100(%rbp),%r8
lea    0xa4b(%rip),%rdi
lea    0xa61(%rip),%rsi
mov    $0x3,%edx
lea    0xa71(%rip),%rcx
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xb8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xb0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x1,-0xa0(%rbp)
mov    -0xc0(%rbp),%rax
mov    %rax,%rsp
jmp    16a3 <generateJson+0x503>
jmp    168f <generateJson+0x4ef>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1421 <generateJson+0x281>
cmpl   $0x0,-0xa0(%rbp)
jne    1735 <generateJson+0x595>
mov    -0x78(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x108(%rbp)
mov    -0x80(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x108(%rbp),%eax
add    %ecx,%eax
add    $0x8,%eax
cltq
mov    %rax,-0xd0(%rbp)
mov    -0x18(%rbp),%rax
add    -0xd0(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1704 <generateJson+0x564>
mov    -0x28(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <myrealloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
add    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    -0x78(%rbp),%rdx
mov    -0x80(%rbp),%rcx
lea    0x94c(%rip),%rsi
mov    $0x0,%al
call   10a0 <sprintf@plt>
mov    -0xd0(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    126f <generateJson+0xcf>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
cmp    -0x10(%rbp),%rax
jbe    1778 <generateJson+0x5d8>
mov    -0x28(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <myrealloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
add    -0x18(%rbp),%rdi
add    $0xffffffffffffffff,%rdi
lea    0x934(%rip),%rsi
mov    $0x0,%al
call   10a0 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   10b0 <getZVMLogLevel@plt>
cmp    $0x1,%eax
jl     17d3 <generateJson+0x633>
mov    -0x1c(%rbp),%r8d
lea    0x909(%rip),%rdi
lea    0x8db(%rip),%rsi
mov    $0x1,%edx
lea    0x913(%rip),%rcx
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateJson>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%r14
movq   $0x400,-0x48(%rbp)
mov    $0x400,%edi
call   1090 <malloc@plt>
movw   $0xa7b,(%rax)
movb   $0x0,0x2(%rax)
mov    %rax,-0x38(%rbp)
mov    %rax,%rdi
call   1050 <strlen@plt>
add    $0xffffffff,%eax
cltq
mov    %rax,-0x30(%rbp)
mov    (%r14),%rdi
test   %rdi,%rdi
je     1521 <generateJson+0x381>
movl   $0x0,-0x4c(%rbp)
jmp    1222 <generateJson+0x82>
nopl   0x0(%rax)
mov    %r12,%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    0x8(%r14),%rdi
add    $0x8,%r14
test   %rdi,%rdi
je     1517 <generateJson+0x377>
call   1050 <strlen@plt>
mov    %eax,%r15d
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%r12
mov    %r15d,%edi
call   1090 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    (%r14),%r13
mov    %r13,%rdi
mov    $0x3d,%esi
call   1060 <strchr@plt>
test   %rax,%rax
je     1200 <generateJson+0x60>
mov    %rax,%rbx
sub    %r13,%rbx
test   %ebx,%ebx
je     1200 <generateJson+0x60>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %ebx,%edx
call   1040 <strncpy@plt>
mov    (%r14),%rax
movslq %ebx,%r13
lea    (%rax,%r13,1),%rsi
add    $0x1,%rsi
sub    %ebx,%r15d
mov    -0x40(%rbp),%rdi
mov    %r15d,%edx
call   1040 <strncpy@plt>
movb   $0x0,(%r12,%r13,1)
mov    %r12,%rdi
lea    0xd68(%rip),%rsi
call   10c0 <strstr@plt>
mov    %rax,-0x58(%rbp)
mov    %r12,%rdi
lea    0xd64(%rip),%rsi
call   10c0 <strstr@plt>
mov    %rax,%rbx
mov    %r12,%rdi
lea    0xd5f(%rip),%rsi
call   10c0 <strstr@plt>
mov    %rax,%r13
mov    %r12,%rdi
lea    0xd60(%rip),%rsi
call   10c0 <strstr@plt>
mov    %rax,%r15
mov    %r12,%rdi
lea    0xd5f(%rip),%rsi
call   10c0 <strstr@plt>
test   %rax,%rax
jne    1305 <generateJson+0x165>
test   %r15,%r15
jne    1305 <generateJson+0x165>
test   %r13,%r13
jne    1305 <generateJson+0x165>
test   %rbx,%rbx
jne    1305 <generateJson+0x165>
cmpq   $0x0,-0x58(%rbp)
je     1211 <generateJson+0x71>
mov    %r12,%rdi
lea    0xd3b(%rip),%rbx
mov    %rbx,%rsi
call   10c0 <strstr@plt>
test   %rax,%rax
jne    1337 <generateJson+0x197>
mov    %r12,%rdi
lea    0xd38(%rip),%rbx
mov    %rbx,%rsi
call   10c0 <strstr@plt>
test   %rax,%rax
je     14b5 <generateJson+0x315>
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%r13
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
mov    %r12,%r15
add    %rax,%r15
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%ebx
mov    %rdi,-0x60(%rbp)
call   1050 <strlen@plt>
sub    %eax,%ebx
add    $0x1,%ebx
mov    %r13,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1040 <strncpy@plt>
mov    %r13,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    -0x40(%rbp),%rdi
call   1050 <strlen@plt>
add    %ebx,%eax
add    $0x8,%eax
cltq
mov    -0x30(%rbp),%rcx
add    %rcx,%rax
cmp    -0x48(%rbp),%rax
mov    %rax,-0x58(%rbp)
jbe    13bf <generateJson+0x21f>
mov    -0x38(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1080 <myrealloc@plt>
mov    -0x30(%rbp),%rcx
jmp    13c3 <generateJson+0x223>
mov    -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    (%rax,%rcx,1),%rdi
add    $0x1,%rdi
lea    0xc93(%rip),%rsi
mov    %r13,-0x30(%rbp)
mov    %r13,%rdx
mov    -0x40(%rbp),%r13
mov    %r13,%rcx
xor    %eax,%eax
call   10a0 <sprintf@plt>
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1050 <strlen@plt>
mov    %rsp,-0x68(%rbp)
add    %ebx,%eax
add    $0x2,%eax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
mov    %r15,%rdi
lea    0xc55(%rip),%rsi
mov    %r12,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   10a0 <sprintf@plt>
xor    %eax,%eax
call   10b0 <getZVMLogLevel@plt>
cmp    $0x3,%eax
jl     145f <generateJson+0x2bf>
lea    0xc3b(%rip),%rdi
lea    0xc51(%rip),%rsi
mov    $0x3,%edx
lea    0xc4f(%rip),%rcx
mov    -0x60(%rbp),%r8
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   10b0 <getZVMLogLevel@plt>
cmp    $0x3,%eax
mov    -0x58(%rbp),%rbx
jl     1493 <generateJson+0x2f3>
lea    0xc06(%rip),%rdi
lea    0xc1c(%rip),%rsi
mov    $0x3,%edx
lea    0xc2c(%rip),%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1070 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
addl   $0x1,-0x4c(%rbp)
mov    -0x68(%rbp),%rsp
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbx,-0x30(%rbp)
jmp    1208 <generateJson+0x68>
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    -0x40(%rbp),%rdi
call   1050 <strlen@plt>
add    %ebx,%eax
add    $0x8,%eax
movslq %eax,%rbx
mov    -0x30(%rbp),%rcx
add    %rcx,%rbx
cmp    -0x48(%rbp),%rbx
jbe    14f0 <generateJson+0x350>
mov    -0x38(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1080 <myrealloc@plt>
mov    -0x30(%rbp),%rcx
jmp    14f4 <generateJson+0x354>
mov    -0x38(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    (%rax,%rcx,1),%rdi
add    $0x1,%rdi
lea    0xb62(%rip),%rsi
mov    %r12,%rdx
mov    -0x40(%rbp),%rcx
xor    %eax,%eax
call   10a0 <sprintf@plt>
jmp    14a4 <generateJson+0x304>
mov    -0x48(%rbp),%rax
mov    -0x4c(%rbp),%r14d
jmp    1529 <generateJson+0x389>
xor    %r14d,%r14d
mov    $0x400,%eax
mov    -0x30(%rbp),%rdx
lea    0x2(%rdx),%rcx
cmp    %rax,%rcx
jbe    1549 <generateJson+0x3a9>
lea    -0x48(%rbp),%rsi
mov    -0x38(%rbp),%rdi
call   1080 <myrealloc@plt>
mov    -0x30(%rbp),%rdx
jmp    154d <generateJson+0x3ad>
mov    -0x38(%rbp),%rax
movb   $0x0,0x1(%rax,%rdx,1)
mov    %rax,%rbx
movw   $0x7d0a,-0x1(%rax,%rdx,1)
xor    %eax,%eax
call   10b0 <getZVMLogLevel@plt>
test   %eax,%eax
jle    158b <generateJson+0x3eb>
lea    0xb52(%rip),%rdi
lea    0xb24(%rip),%rsi
lea    0xb61(%rip),%rcx
mov    $0x1,%edx
mov    %r14d,%r8d
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"CONTENT_LENGTH\00"
@.str.1 = [13 x i8] c"CONTENT_TYPE\00"
@.str.2 = [19 x i8] c"HTTP_X_OBJECT_META\00"
@.str.3 = [17 x i8] c"HTTP_X_TIMESTAMP\00"
@.str.4 = [10 x i8] c"PATH_INFO\00"
@.str.5 = [20 x i8] c"HTTP_X_OBJECT_META_\00"
@.str.6 = [8 x i8] c"HTTP_X_\00"
@__const.generateJson.tagfilters_remove_prefix = [2 x i8*] [i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i32 0, i32 0)]
@.str.7 = [3 x i8] c"{\0A\00"
@.str.8 = [2 x i8] c"=\00"
@.str.9 = [13 x i8] c"\09\22%s\22:\22%s\22,\0A\00"
@.str.10 = [6 x i8] c"%s:%s\00"
@.str.11 = [29 x i8] c"%s [LogLevel=%d] [%s], \09%s \0A\00"
@.str.12 = [10 x i8] c"***ZVMLog\00"
@.str.13 = [18 x i8] c"remove prefix key\00"
@.str.14 = [8 x i8] c"Key:Val\00"
@.str.15 = [3 x i8] c"\0A}\00"
@.str.16 = [29 x i8] c"%s [LogLevel=%d] [%s], \09%d \0A\00"
@.str.17 = [15 x i8] c"json key count\00"
define i8* @generateJson(i8** %0) {
%2 = alloca i8**
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [5 x i8*]
%8 = alloca [2 x i8*]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i8*
%22 = alloca i64
%23 = alloca i8*
%24 = alloca i64
%25 = alloca i64
store i8** %0, i8*** %2
store i64 1024, i64* %3
store i64 0, i64* %4
store i32 0, i32* %5
%26 = load i64, i64* %3
%27 = mul i64 1, %26
%28 = trunc i64 %27 to i32
%29 = call i64 @malloc(i32 %28)
%30 = inttoptr i64 %29 to i8*
store i8* %30, i8** %6
%31 = bitcast [5 x i8*]* %7 to i8*
%32 = bitcast i8* %31 to [5 x i8*]*
%33 = getelementptr inbounds [5 x i8*], [5 x i8*]* %32, i32 0, i32 0
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0), i8** %33
%34 = getelementptr inbounds [5 x i8*], [5 x i8*]* %32, i32 0, i32 1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i32 0, i32 0), i8** %34
%35 = getelementptr inbounds [5 x i8*], [5 x i8*]* %32, i32 0, i32 2
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i32 0, i32 0), i8** %35
%36 = getelementptr inbounds [5 x i8*], [5 x i8*]* %32, i32 0, i32 3
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i32 0, i32 0), i8** %36
%37 = getelementptr inbounds [5 x i8*], [5 x i8*]* %32, i32 0, i32 4
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i32 0, i32 0), i8** %37
%38 = bitcast [2 x i8*]* %8 to i8*
store i32 5, i32* %9
store i32 2, i32* %10
%39 = load i8*, i8** %6
%40 = call i32 (i8*, i8*, ...) @sprintf(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%41 = load i8*, i8** %6
%42 = call i32 @strlen(i8* %41)
%43 = sub nsw i32 %42, 1
%44 = sext i32 %43 to i64
store i64 %44, i64* %4
store i32 0, i32* %11
br label %45
45: ; preds = %281, %1
%46 = load i8**, i8*** %2
%47 = load i32, i32* %11
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8*, i8** %46, i64 %48
%50 = load i8*, i8** %49
%51 = icmp ne i8* %50, null
br i1 %51, label %52, label %284
52: ; preds = %45
%53 = load i8**, i8*** %2
%54 = load i32, i32* %11
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %53, i64 %55
%57 = load i8*, i8** %56
%58 = call i32 @strlen(i8* %57)
store i32 %58, i32* %12
%59 = load i32, i32* %12
%60 = sext i32 %59 to i64
%61 = mul i64 %60, 1
%62 = trunc i64 %61 to i32
%63 = call i64 @malloc(i32 %62)
%64 = inttoptr i64 %63 to i8*
store i8* %64, i8** %13
%65 = load i32, i32* %12
%66 = sext i32 %65 to i64
%67 = mul i64 %66, 1
%68 = trunc i64 %67 to i32
%69 = call i64 @malloc(i32 %68)
%70 = inttoptr i64 %69 to i8*
store i8* %70, i8** %14
store i32 0, i32* %16
%71 = load i8**, i8*** %2
%72 = load i32, i32* %11
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8*, i8** %71, i64 %73
%75 = load i8*, i8** %74
%76 = call i8* @strstr(i8* %75, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i8* %76, i8** %15
%77 = icmp ne i8* %76, null
br i1 %77, label %78, label %89
78: ; preds = %52
%79 = load i8*, i8** %15
%80 = load i8**, i8*** %2
%81 = load i32, i32* %11
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8*, i8** %80, i64 %82
%84 = load i8*, i8** %83
%85 = ptrtoint i8* %79 to i64
%86 = ptrtoint i8* %84 to i64
%87 = sub i64 %85, %86
%88 = trunc i64 %87 to i32
store i32 %88, i32* %16
br label %89
89: ; preds = %78, %52
%90 = load i32, i32* %16
%91 = icmp eq i32 %90, 0
br i1 %91, label %92, label %97
92: ; preds = %89
%93 = load i8*, i8** %13
%94 = call i32 @free(i8* %93)
%95 = load i8*, i8** %14
%96 = call i32 @free(i8* %95)
br label %281
97: ; preds = %89
%98 = load i8*, i8** %13
%99 = load i8**, i8*** %2
%100 = load i32, i32* %11
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i8*, i8** %99, i64 %101
%103 = load i8*, i8** %102
%104 = load i32, i32* %16
%105 = call i32 @strncpy(i8* %98, i8* %103, i32 %104)
%106 = load i8*, i8** %14
%107 = load i8**, i8*** %2
%108 = load i32, i32* %11
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8*, i8** %107, i64 %109
%111 = load i8*, i8** %110
%112 = load i32, i32* %16
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8, i8* %111, i64 %113
%115 = getelementptr inbounds i8, i8* %114, i64 1
%116 = load i32, i32* %12
%117 = load i32, i32* %16
%118 = sub nsw i32 %116, %117
%119 = call i32 @strncpy(i8* %106, i8* %115, i32 %118)
%120 = load i8*, i8** %13
%121 = load i32, i32* %16
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds i8, i8* %120, i64 %122
store i8 0, i8* %123
store i32 0, i32* %18
store i32 0, i32* %19
store i32 0, i32* %20
store i32 0, i32* %20
br label %124
124: ; preds = %138, %97
%125 = load i32, i32* %20
%126 = load i32, i32* %9
%127 = icmp slt i32 %125, %126
br i1 %127, label %128, label %141
128: ; preds = %124
%129 = load i8*, i8** %13
%130 = load i32, i32* %20
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds [5 x i8*], [5 x i8*]* %7, i64 0, i64 %131
%133 = load i8*, i8** %132
%134 = call i8* @strstr(i8* %129, i8* %133)
store i8* %134, i8** %17
%135 = icmp ne i8* %134, null
br i1 %135, label %136, label %137
136: ; preds = %128
store i32 1, i32* %18
br label %137
137: ; preds = %136, %128
br label %138
138: ; preds = %137
%139 = load i32, i32* %20
%140 = add nsw i32 %139, 1
store i32 %140, i32* %20
br label %124
141: ; preds = %124
%142 = load i32, i32* %18
%143 = icmp eq i32 %142, 0
br i1 %143, label %144, label %145
144: ; preds = %141
br label %281
145: ; preds = %141
store i32 0, i32* %20
br label %146
146: ; preds = %243, %145
%147 = load i32, i32* %20
%148 = load i32, i32* %10
%149 = icmp slt i32 %147, %148
br i1 %149, label %150, label %246
150: ; preds = %146
%151 = load i8*, i8** %13
%152 = load i32, i32* %20
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [2 x i8*], [2 x i8*]* %8, i64 0, i64 %153
%155 = load i8*, i8** %154
%156 = call i8* @strstr(i8* %151, i8* %155)
store i8* %156, i8** %17
%157 = icmp ne i8* %156, null
br i1 %157, label %158, label %242
158: ; preds = %150
%159 = load i8*, i8** %13
%160 = call i32 @strlen(i8* %159)
%161 = sext i32 %160 to i64
%162 = mul i64 1, %161
%163 = trunc i64 %162 to i32
%164 = call i64 @malloc(i32 %163)
%165 = inttoptr i64 %164 to i8*
store i8* %165, i8** %21
%166 = load i8*, i8** %21
%167 = load i8*, i8** %13
%168 = load i32, i32* %20
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [2 x i8*], [2 x i8*]* %8, i64 0, i64 %169
%171 = load i8*, i8** %170
%172 = call i32 @strlen(i8* %171)
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds i8, i8* %167, i64 %173
%175 = load i8*, i8** %13
%176 = call i32 @strlen(i8* %175)
%177 = load i32, i32* %20
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds [2 x i8*], [2 x i8*]* %8, i64 0, i64 %178
%180 = load i8*, i8** %179
%181 = call i32 @strlen(i8* %180)
%182 = sub nsw i32 %176, %181
%183 = add nsw i32 %182, 1
%184 = call i32 @strncpy(i8* %166, i8* %174, i32 %183)
%185 = load i8*, i8** %21
%186 = call i32 @strlen(i8* %185)
%187 = load i8*, i8** %14
%188 = call i32 @strlen(i8* %187)
%189 = add nsw i32 %186, %188
%190 = add nsw i32 %189, 8
%191 = sext i32 %190 to i64
store i64 %191, i64* %22
%192 = load i64, i64* %4
%193 = load i64, i64* %22
%194 = add i64 %192, %193
%195 = load i64, i64* %3
%196 = icmp ugt i64 %194, %195
br i1 %196, label %197, label %200
197: ; preds = %158
%198 = load i8*, i8** %6
%199 = call i8* @myrealloc(i8* %198, i64* %3)
store i8* %199, i8** %6
br label %200
200: ; preds = %197, %158
%201 = load i8*, i8** %6
%202 = load i64, i64* %4
%203 = getelementptr inbounds i8, i8* %201, i64 %202
%204 = getelementptr inbounds i8, i8* %203, i64 1
%205 = load i8*, i8** %21
%206 = load i8*, i8** %14
%207 = call i32 (i8*, i8*, ...) @sprintf(i8* %204, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %205, i8* %206)
%208 = load i8*, i8** %13
%209 = call i32 @strlen(i8* %208)
%210 = load i8*, i8** %14
%211 = call i32 @strlen(i8* %210)
%212 = add nsw i32 %209, %211
%213 = add nsw i32 %212, 2
%214 = zext i32 %213 to i64
%215 = call i8* @llvm.stacksave()
store i8* %215, i8** %23
%216 = alloca i8, i64 %214
store i64 %214, i64* %24
%217 = load i8*, i8** %13
%218 = load i8*, i8** %14
%219 = call i32 (i8*, i8*, ...) @sprintf(i8* %216, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* %217, i8* %218)
%220 = call i32 (...) @getZVMLogLevel()
%221 = icmp sge i32 %220, 3
br i1 %221, label %222, label %228
222: ; preds = %200
%223 = load i32, i32* %20
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds [2 x i8*], [2 x i8*]* %8, i64 0, i64 %224
%226 = load i8*, i8** %225
%227 = call i32 (i8*, i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i8* %226)
br label %228
228: ; preds = %222, %200
%229 = call i32 (...) @getZVMLogLevel()
%230 = icmp sge i32 %229, 3
br i1 %230, label %231, label %233
231: ; preds = %228
%232 = call i32 (i8*, i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* %216)
br label %233
233: ; preds = %231, %228
%234 = load i64, i64* %22
%235 = load i64, i64* %4
%236 = add i64 %235, %234
store i64 %236, i64* %4
%237 = load i8*, i8** %21
%238 = call i32 @free(i8* %237)
%239 = load i32, i32* %5
%240 = add nsw i32 %239, 1
store i32 %240, i32* %5
store i32 1, i32* %19
%241 = load i8*, i8** %23
br label %246
242: ; preds = %150
br label %243
243: ; preds = %242
%244 = load i32, i32* %20
%245 = add nsw i32 %244, 1
store i32 %245, i32* %20
br label %146
246: ; preds = %233, %146
%247 = load i32, i32* %19
%248 = icmp eq i32 %247, 0
br i1 %248, label %249, label %276
249: ; preds = %246
%250 = load i8*, i8** %13
%251 = call i32 @strlen(i8* %250)
%252 = load i8*, i8** %14
%253 = call i32 @strlen(i8* %252)
%254 = add nsw i32 %251, %253
%255 = add nsw i32 %254, 8
%256 = sext i32 %255 to i64
store i64 %256, i64* %25
%257 = load i64, i64* %4
%258 = load i64, i64* %25
%259 = add i64 %257, %258
%260 = load i64, i64* %3
%261 = icmp ugt i64 %259, %260
br i1 %261, label %262, label %265
262: ; preds = %249
%263 = load i8*, i8** %6
%264 = call i8* @myrealloc(i8* %263, i64* %3)
store i8* %264, i8** %6
br label %265
265: ; preds = %262, %249
%266 = load i8*, i8** %6
%267 = load i64, i64* %4
%268 = getelementptr inbounds i8, i8* %266, i64 %267
%269 = getelementptr inbounds i8, i8* %268, i64 1
%270 = load i8*, i8** %13
%271 = load i8*, i8** %14
%272 = call i32 (i8*, i8*, ...) @sprintf(i8* %269, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %270, i8* %271)
%273 = load i64, i64* %25
%274 = load i64, i64* %4
%275 = add i64 %274, %273
store i64 %275, i64* %4
br label %276
276: ; preds = %265, %246
%277 = load i8*, i8** %13
%278 = call i32 @free(i8* %277)
%279 = load i8*, i8** %14
%280 = call i32 @free(i8* %279)
br label %281
281: ; preds = %276, %144, %92
%282 = load i32, i32* %11
%283 = add nsw i32 %282, 1
store i32 %283, i32* %11
br label %45
284: ; preds = %45
%285 = load i64, i64* %4
%286 = add i64 %285, 2
%287 = load i64, i64* %3
%288 = icmp ugt i64 %286, %287
br i1 %288, label %289, label %292
289: ; preds = %284
%290 = load i8*, i8** %6
%291 = call i8* @myrealloc(i8* %290, i64* %3)
store i8* %291, i8** %6
br label %292
292: ; preds = %289, %284
%293 = load i8*, i8** %6
%294 = load i64, i64* %4
%295 = getelementptr inbounds i8, i8* %293, i64 %294
%296 = getelementptr inbounds i8, i8* %295, i64 -1
%297 = call i32 (i8*, i8*, ...) @sprintf(i8* %296, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%298 = load i64, i64* %4
%299 = add i64 %298, 2
store i64 %299, i64* %4
%300 = call i32 (...) @getZVMLogLevel()
%301 = icmp sge i32 %300, 1
br i1 %301, label %302, label %305
302: ; preds = %292
%303 = load i32, i32* %5
%304 = call i32 (i8*, i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0), i32 %303)
br label %305
305: ; preds = %302, %292
%306 = load i8*, i8** %6
ret i8* %306
}

LLVM IR (-O2):
@.str = [15 x i8] c"CONTENT_LENGTH\00"
@.str.1 = [13 x i8] c"CONTENT_TYPE\00"
@.str.2 = [19 x i8] c"HTTP_X_OBJECT_META\00"
@.str.3 = [17 x i8] c"HTTP_X_TIMESTAMP\00"
@.str.4 = [10 x i8] c"PATH_INFO\00"
@.str.5 = [20 x i8] c"HTTP_X_OBJECT_META_\00"
@.str.6 = [8 x i8] c"HTTP_X_\00"
@.str.7 = [3 x i8] c"{\0A\00"
@.str.9 = [13 x i8] c"\09\22%s\22:\22%s\22,\0A\00"
@.str.10 = [6 x i8] c"%s:%s\00"
@.str.11 = [29 x i8] c"%s [LogLevel=%d] [%s], \09%s \0A\00"
@.str.12 = [10 x i8] c"***ZVMLog\00"
@.str.13 = [18 x i8] c"remove prefix key\00"
@.str.14 = [8 x i8] c"Key:Val\00"
@.str.15 = [3 x i8] c"\0A}\00"
@.str.16 = [29 x i8] c"%s [LogLevel=%d] [%s], \09%d \0A\00"
@.str.17 = [15 x i8] c"json key count\00"
define i8* @generateJson(i8** nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 1024, i64* %2
%4 = tail call i64 @malloc(i32 1024)
%5 = inttoptr i64 %4 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %5, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i64 3, i1 false)
%6 = tail call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, -1
%8 = sext i32 %7 to i64
%9 = load i8*, i8** %0
%10 = icmp eq i8* %9, null
br i1 %10, label %148, label %11
11: ; preds = %1, %138
%12 = phi i64 [ %142, %138 ], [ 0, %1 ]
%13 = phi i8* [ %144, %138 ], [ %9, %1 ]
%14 = phi i8** [ %143, %138 ], [ %0, %1 ]
%15 = phi i64 [ %141, %138 ], [ %8, %1 ]
%16 = phi i32 [ %140, %138 ], [ 0, %1 ]
%17 = phi i8* [ %139, %138 ], [ %5, %1 ]
%18 = call i32 @strlen(i8* %13)
%19 = call i64 @malloc(i32 %18)
%20 = inttoptr i64 %19 to i8*
%21 = call i64 @malloc(i32 %18)
%22 = inttoptr i64 %21 to i8*
%23 = load i8*, i8** %14
%24 = call i8* @strchr(i8* dereferenceable(1) %23, i32 61)
%25 = icmp eq i8* %24, null
%26 = ptrtoint i8* %24 to i64
%27 = ptrtoint i8* %23 to i64
%28 = sub i64 %26, %27
%29 = trunc i64 %28 to i32
%30 = icmp eq i32 %29, 0
%31 = select i1 %25, i1 true, i1 %30
br i1 %31, label %32, label %34
32: ; preds = %11
%33 = call i32 @free(i8* %20)
br label %133
34: ; preds = %11
%35 = call i32 @strncpy(i8* %20, i8* %23, i32 %29)
%36 = load i8*, i8** %14
%37 = shl i64 %28, 32
%38 = ashr exact i64 %37, 32
%39 = getelementptr inbounds i8, i8* %36, i64 1
%40 = getelementptr inbounds i8, i8* %39, i64 %38
%41 = sub nsw i32 %18, %29
%42 = call i32 @strncpy(i8* %22, i8* %40, i32 %41)
%43 = getelementptr inbounds i8, i8* %20, i64 %38
store i8 0, i8* %43
%44 = call i8* @strstr(i8* dereferenceable(1) %20, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%45 = icmp eq i8* %44, null
%46 = call i8* @strstr(i8* dereferenceable(1) %20, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%47 = icmp eq i8* %46, null
%48 = call i8* @strstr(i8* dereferenceable(1) %20, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%49 = icmp eq i8* %48, null
%50 = call i8* @strstr(i8* dereferenceable(1) %20, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%51 = icmp eq i8* %50, null
%52 = call i8* @strstr(i8* dereferenceable(1) %20, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%53 = icmp eq i8* %52, null
%54 = select i1 %53, i1 %51, i1 false
%55 = select i1 %54, i1 %49, i1 false
%56 = select i1 %55, i1 %47, i1 false
%57 = select i1 %56, i1 %45, i1 false
br i1 %57, label %138, label %58
58: ; preds = %34
%59 = call i8* @strstr(i8* dereferenceable(1) %20, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
%60 = icmp eq i8* %59, null
br i1 %60, label %61, label %73
61: ; preds = %58
%62 = call i8* @strstr(i8* dereferenceable(1) %20, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%63 = icmp eq i8* %62, null
br i1 %63, label %64, label %73
64: ; preds = %61
%65 = call i32 @strlen(i8* %20)
%66 = call i32 @strlen(i8* %22)
%67 = add i32 %65, 8
%68 = add i32 %67, %66
%69 = sext i32 %68 to i64
%70 = add i64 %15, %69
%71 = load i64, i64* %2
%72 = icmp ugt i64 %70, %71
br i1 %72, label %121, label %123
73: ; preds = %61, %58
%74 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), %58 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), %61 ]
%75 = call i32 @strlen(i8* %20)
%76 = call i64 @malloc(i32 %75)
%77 = inttoptr i64 %76 to i8*
%78 = call i32 @strlen(i8* %74)
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %20, i64 %79
%81 = call i32 @strlen(i8* %20)
%82 = call i32 @strlen(i8* %74)
%83 = add i32 %81, 1
%84 = sub i32 %83, %82
%85 = call i32 @strncpy(i8* %77, i8* %80, i32 %84)
%86 = call i32 @strlen(i8* %77)
%87 = call i32 @strlen(i8* %22)
%88 = add i32 %86, 8
%89 = add i32 %88, %87
%90 = sext i32 %89 to i64
%91 = add i64 %15, %90
%92 = load i64, i64* %2
%93 = icmp ugt i64 %91, %92
br i1 %93, label %94, label %96
94: ; preds = %73
%95 = call i8* @myrealloc(i8* %17, i64* %2)
br label %96
96: ; preds = %94, %73
%97 = phi i8* [ %95, %94 ], [ %17, %73 ]
%98 = getelementptr inbounds i8, i8* %97, i64 1
%99 = getelementptr inbounds i8, i8* %98, i64 %15
%100 = call i32 (i8*, i8*, ...) @sprintf(i8* %99, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %77, i8* %22)
%101 = call i32 @strlen(i8* %20)
%102 = call i32 @strlen(i8* %22)
%103 = add i32 %101, 2
%104 = add i32 %103, %102
%105 = zext i32 %104 to i64
%106 = call i8* @llvm.stacksave()
%107 = alloca i8, i64 %105
%108 = call i32 (i8*, i8*, ...) @sprintf(i8* %107, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* %20, i8* %22)
%109 = call i32 (...) @getZVMLogLevel()
%110 = icmp sgt i32 %109, 2
br i1 %110, label %111, label %113
111: ; preds = %96
%112 = call i32 (i8*, i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i8* %74)
br label %113
113: ; preds = %111, %96
%114 = call i32 (...) @getZVMLogLevel()
%115 = icmp sgt i32 %114, 2
br i1 %115, label %116, label %118
116: ; preds = %113
%117 = call i32 (i8*, i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i8* %107)
br label %118
118: ; preds = %113, %116
%119 = call i32 @free(i8* %77)
%120 = add nsw i32 %16, 1
br label %128
121: ; preds = %64
%122 = call i8* @myrealloc(i8* %17, i64* %2)
br label %123
123: ; preds = %121, %64
%124 = phi i8* [ %122, %121 ], [ %17, %64 ]
%125 = getelementptr inbounds i8, i8* %124, i64 1
%126 = getelementptr inbounds i8, i8* %125, i64 %15
%127 = call i32 (i8*, i8*, ...) @sprintf(i8* %126, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %20, i8* %22)
br label %128
128: ; preds = %118, %123
%129 = phi i32 [ %16, %123 ], [ %120, %118 ]
%130 = phi i8* [ %124, %123 ], [ %97, %118 ]
%131 = phi i64 [ %70, %123 ], [ %91, %118 ]
%132 = call i32 @free(i8* %20)
br label %133
133: ; preds = %32, %128
%134 = phi i8* [ %130, %128 ], [ %17, %32 ]
%135 = phi i32 [ %129, %128 ], [ %16, %32 ]
%136 = phi i64 [ %131, %128 ], [ %15, %32 ]
%137 = call i32 @free(i8* %22)
br label %138
138: ; preds = %133, %34
%139 = phi i8* [ %17, %34 ], [ %134, %133 ]
%140 = phi i32 [ %16, %34 ], [ %135, %133 ]
%141 = phi i64 [ %15, %34 ], [ %136, %133 ]
%142 = add nuw i64 %12, 1
%143 = getelementptr inbounds i8*, i8** %0, i64 %142
%144 = load i8*, i8** %143
%145 = icmp eq i8* %144, null
br i1 %145, label %146, label %11
146: ; preds = %138
%147 = load i64, i64* %2
br label %148
148: ; preds = %146, %1
%149 = phi i64 [ 1024, %1 ], [ %147, %146 ]
%150 = phi i8* [ %5, %1 ], [ %139, %146 ]
%151 = phi i32 [ 0, %1 ], [ %140, %146 ]
%152 = phi i64 [ %8, %1 ], [ %141, %146 ]
%153 = add i64 %152, 2
%154 = icmp ugt i64 %153, %149
br i1 %154, label %155, label %157
155: ; preds = %148
%156 = call i8* @myrealloc(i8* %150, i64* %2)
br label %157
157: ; preds = %155, %148
%158 = phi i8* [ %156, %155 ], [ %150, %148 ]
%159 = getelementptr inbounds i8, i8* %158, i64 %152
%160 = getelementptr inbounds i8, i8* %159, i64 -1
%161 = call i32 (...) @getZVMLogLevel()
%162 = icmp sgt i32 %161, 0
br i1 %162, label %163, label %165
163: ; preds = %157
%164 = call i32 (i8*, i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0), i32 %151)
br label %165
165: ; preds = %163, %157
ret i8* %158
}