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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ log_all(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, int);
char *realloc(char *, int);
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
char *strstr(char *, char *);
char *get_pid_query(char *req) {
  int headers_len = strlen(req);
  if (headers_len > 1000 || headers_len < 40) {
    log_all("String is out of bounds");
    printf("%d\n", headers_len);
    return NULL;
  } else {
    if (req[0] != 'G' || req[1] != 'E' || req[2] != 'T') {
      log_all("String contains no GET specification");
      return NULL;
    } else if (!strcmp(&req[5], "?") || !strcmp(&req[6], "p") ||
               !strcmp(&req[7], "i") || !strcmp(&req[8], "d") ||
               !strcmp(&req[9], "=")) {
      log_all("String contains no PID query");
      return NULL;
    } else {
      char *sreq = strstr(req, "pid=");
      if (sreq != NULL) {
        char *pid = malloc(8);
        int i = 4;
        while ((sreq + i)[0] != ' ' && i < 12) {
          pid[i - 4] = sreq[i];
          i++;
        }
        int pidlen = strlen(pid);
        if (pidlen > 3 || pidlen < 8) {
          pid = realloc(pid, pidlen);
          return pid;
        } else {
          free(pid);
          return NULL;
        }
      } else {
        log_all("Could not locate substring in request");
        return NULL;
      }
    }
  }
}


x86 assembly (clang, -O0):
<get_pid_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jg     11af <get_pid_query+0x2f>
cmpl   $0x28,-0x14(%rbp)
jge    11d7 <get_pid_query+0x57>
lea    0xe4a(%rip),%rdi
call   1090 <log_all@plt>
mov    -0x14(%rbp),%esi
lea    0xe53(%rip),%rdi
call   1050 <printf@plt>
movq   $0x0,-0x8(%rbp)
jmp    13c4 <get_pid_query+0x244>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x47,%eax
jne    1209 <get_pid_query+0x89>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x45,%eax
jne    1209 <get_pid_query+0x89>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x54,%eax
je     1222 <get_pid_query+0xa2>
lea    0xe0c(%rip),%rdi
call   1090 <log_all@plt>
movq   $0x0,-0x8(%rbp)
jmp    13c4 <get_pid_query+0x244>
mov    -0x10(%rbp),%rdi
add    $0x5,%rdi
lea    0xe10(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     12b3 <get_pid_query+0x133>
mov    -0x10(%rbp),%rdi
add    $0x6,%rdi
lea    0xdf5(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     12b3 <get_pid_query+0x133>
mov    -0x10(%rbp),%rdi
add    $0x7,%rdi
lea    0xdda(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     12b3 <get_pid_query+0x133>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
lea    0xdbf(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     12b3 <get_pid_query+0x133>
mov    -0x10(%rbp),%rdi
add    $0x9,%rdi
lea    0xdc4(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12cc <get_pid_query+0x14c>
lea    0xd8f(%rip),%rdi
call   1090 <log_all@plt>
movq   $0x0,-0x8(%rbp)
jmp    13c4 <get_pid_query+0x244>
mov    -0x10(%rbp),%rdi
lea    0xd8f(%rip),%rsi
call   10a0 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     13b0 <get_pid_query+0x230>
mov    $0x8,%edi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
movl   $0x4,-0x2c(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x31(%rbp)
je     1324 <get_pid_query+0x1a4>
cmpl   $0xc,-0x2c(%rbp)
setl   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
test   $0x1,%al
jne    1334 <get_pid_query+0x1b4>
jmp    135d <get_pid_query+0x1dd>
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x4,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1300 <get_pid_query+0x180>
mov    -0x28(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x3,-0x30(%rbp)
jg     137d <get_pid_query+0x1fd>
cmpl   $0x8,-0x30(%rbp)
jge    139a <get_pid_query+0x21a>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%esi
call   1080 <realloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    13c4 <get_pid_query+0x244>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    13c4 <get_pid_query+0x244>
lea    0xcb4(%rip),%rdi
call   1090 <log_all@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pid_query>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebx
lea    -0x3e9(%rbx),%eax
cmp    $0xfffffc3e,%eax
ja     11aa <get_pid_query+0x3a>
lea    0xe6e(%rip),%rdi
call   1080 <log_all@plt>
lea    0xe7a(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
jmp    12e6 <get_pid_query+0x176>
cmpb   $0x47,(%r14)
jne    12da <get_pid_query+0x16a>
cmpb   $0x45,0x1(%r14)
jne    12da <get_pid_query+0x16a>
cmpb   $0x54,0x2(%r14)
jne    12da <get_pid_query+0x16a>
lea    0x5(%r14),%rdi
lea    0xe6c(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12f0 <get_pid_query+0x180>
lea    0x6(%r14),%rdi
lea    0xe56(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12f0 <get_pid_query+0x180>
lea    0x7(%r14),%rdi
lea    0xe40(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12f0 <get_pid_query+0x180>
lea    0x8(%r14),%rdi
lea    0xe2a(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12f0 <get_pid_query+0x180>
lea    0x9(%r14),%rdi
lea    0xe34(%rip),%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
je     12f0 <get_pid_query+0x180>
lea    0xe1d(%rip),%rsi
mov    %r14,%rdi
call   1090 <strstr@plt>
test   %rax,%rax
je     12f9 <get_pid_query+0x189>
mov    %rax,%rbx
mov    $0x8,%edi
call   1060 <malloc@plt>
mov    %rax,%r14
mov    0x4(%rbx),%al
cmp    $0x20,%al
je     12c1 <get_pid_query+0x151>
mov    %al,(%r14)
mov    0x5(%rbx),%al
cmp    $0x20,%al
je     12c1 <get_pid_query+0x151>
mov    %al,0x1(%r14)
mov    0x6(%rbx),%al
cmp    $0x20,%al
je     12c1 <get_pid_query+0x151>
mov    %al,0x2(%r14)
mov    0x7(%rbx),%al
cmp    $0x20,%al
je     12c1 <get_pid_query+0x151>
mov    %al,0x3(%r14)
mov    0x8(%rbx),%al
cmp    $0x20,%al
je     12c1 <get_pid_query+0x151>
mov    %al,0x4(%r14)
mov    0x9(%rbx),%al
cmp    $0x20,%al
je     12c1 <get_pid_query+0x151>
mov    %al,0x5(%r14)
mov    0xa(%rbx),%al
cmp    $0x20,%al
je     12c1 <get_pid_query+0x151>
mov    %al,0x6(%r14)
mov    0xb(%rbx),%al
cmp    $0x20,%al
je     12c1 <get_pid_query+0x151>
mov    %al,0x7(%r14)
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <realloc@plt>
lea    0xd3b(%rip),%rdi
call   1080 <log_all@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xd52(%rip),%rdi
jmp    12e1 <get_pid_query+0x171>
lea    0xd6b(%rip),%rdi
jmp    12e1 <get_pid_query+0x171>

LLVM IR (-O0):
@.str = [24 x i8] c"String is out of bounds\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [37 x i8] c"String contains no GET specification\00"
@.str.3 = [2 x i8] c"?\00"
@.str.4 = [2 x i8] c"p\00"
@.str.5 = [2 x i8] c"i\00"
@.str.6 = [2 x i8] c"d\00"
@.str.7 = [2 x i8] c"=\00"
@.str.8 = [29 x i8] c"String contains no PID query\00"
@.str.9 = [5 x i8] c"pid=\00"
@.str.10 = [38 x i8] c"Could not locate substring in request\00"
define i8* @get_pid_query(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 1000
br i1 %12, label %16, label %13
13: ; preds = %1
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 40
br i1 %15, label %16, label %20
16: ; preds = %13, %1
%17 = call i32 @log_all(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* %4
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
store i8* null, i8** %2
br label %119
20: ; preds = %13
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 71
br i1 %25, label %38, label %26
26: ; preds = %20
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp ne i32 %30, 69
br i1 %31, label %38, label %32
32: ; preds = %26
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i64 2
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 84
br i1 %37, label %38, label %40
38: ; preds = %32, %26, %20
%39 = call i32 @log_all(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
store i8* null, i8** %2
br label %119
40: ; preds = %32
%41 = load i8*, i8** %3
%42 = getelementptr inbounds i8, i8* %41, i64 5
%43 = call i32 @strcmp(i8* %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %65
45: ; preds = %40
%46 = load i8*, i8** %3
%47 = getelementptr inbounds i8, i8* %46, i64 6
%48 = call i32 @strcmp(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %65
50: ; preds = %45
%51 = load i8*, i8** %3
%52 = getelementptr inbounds i8, i8* %51, i64 7
%53 = call i32 @strcmp(i8* %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %65
55: ; preds = %50
%56 = load i8*, i8** %3
%57 = getelementptr inbounds i8, i8* %56, i64 8
%58 = call i32 @strcmp(i8* %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%59 = icmp ne i32 %58, 0
br i1 %59, label %60, label %65
60: ; preds = %55
%61 = load i8*, i8** %3
%62 = getelementptr inbounds i8, i8* %61, i64 9
%63 = call i32 @strcmp(i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%64 = icmp ne i32 %63, 0
br i1 %64, label %67, label %65
65: ; preds = %60, %55, %50, %45, %40
%66 = call i32 @log_all(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0))
store i8* null, i8** %2
br label %119
67: ; preds = %60
%68 = load i8*, i8** %3
%69 = call i8* @strstr(i8* %68, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
store i8* %69, i8** %5
%70 = load i8*, i8** %5
%71 = icmp ne i8* %70, null
br i1 %71, label %72, label %117
72: ; preds = %67
%73 = call i8* @malloc(i32 8)
store i8* %73, i8** %6
store i32 4, i32* %7
br label %74
74: ; preds = %88, %72
%75 = load i8*, i8** %5
%76 = load i32, i32* %7
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %75, i64 %77
%79 = getelementptr inbounds i8, i8* %78, i64 0
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp ne i32 %81, 32
br i1 %82, label %83, label %86
83: ; preds = %74
%84 = load i32, i32* %7
%85 = icmp slt i32 %84, 12
br label %86
86: ; preds = %83, %74
%87 = phi i1 [ false, %74 ], [ %85, %83 ]
br i1 %87, label %88, label %101
88: ; preds = %86
%89 = load i8*, i8** %5
%90 = load i32, i32* %7
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i8, i8* %89, i64 %91
%93 = load i8, i8* %92
%94 = load i8*, i8** %6
%95 = load i32, i32* %7
%96 = sub nsw i32 %95, 4
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i8, i8* %94, i64 %97
store i8 %93, i8* %98
%99 = load i32, i32* %7
%100 = add nsw i32 %99, 1
store i32 %100, i32* %7
br label %74
101: ; preds = %86
%102 = load i8*, i8** %6
%103 = call i32 @strlen(i8* %102)
store i32 %103, i32* %8
%104 = load i32, i32* %8
%105 = icmp sgt i32 %104, 3
br i1 %105, label %109, label %106
106: ; preds = %101
%107 = load i32, i32* %8
%108 = icmp slt i32 %107, 8
br i1 %108, label %109, label %114
109: ; preds = %106, %101
%110 = load i8*, i8** %6
%111 = load i32, i32* %8
%112 = call i8* @realloc(i8* %110, i32 %111)
store i8* %112, i8** %6
%113 = load i8*, i8** %6
store i8* %113, i8** %2
br label %119
114: ; preds = %106
%115 = load i8*, i8** %6
%116 = call i32 @free(i8* %115)
store i8* null, i8** %2
br label %119
117: ; preds = %67
%118 = call i32 @log_all(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
store i8* null, i8** %2
br label %119
119: ; preds = %117, %114, %109, %65, %38, %16
%120 = load i8*, i8** %2
ret i8* %120
}

LLVM IR (-O2):
@.str = [24 x i8] c"String is out of bounds\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [37 x i8] c"String contains no GET specification\00"
@.str.3 = [2 x i8] c"?\00"
@.str.4 = [2 x i8] c"p\00"
@.str.5 = [2 x i8] c"i\00"
@.str.6 = [2 x i8] c"d\00"
@.str.7 = [2 x i8] c"=\00"
@.str.8 = [29 x i8] c"String contains no PID query\00"
@.str.9 = [5 x i8] c"pid=\00"
@.str.10 = [38 x i8] c"Could not locate substring in request\00"
define i8* @get_pid_query(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add i32 %2, -1001
%4 = icmp ult i32 %3, -961
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @log_all(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
br label %92
8: ; preds = %1
%9 = load i8, i8* %0
%10 = icmp eq i8 %9, 71
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = getelementptr inbounds i8, i8* %0, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 69
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = getelementptr inbounds i8, i8* %0, i64 2
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 84
br i1 %18, label %21, label %19
19: ; preds = %15, %11, %8
%20 = tail call i32 @log_all(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %92
21: ; preds = %15
%22 = getelementptr inbounds i8, i8* %0, i64 5
%23 = tail call i32 @strcmp(i8* %22, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
br i1 %24, label %41, label %25
25: ; preds = %21
%26 = getelementptr inbounds i8, i8* %0, i64 6
%27 = tail call i32 @strcmp(i8* %26, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %41, label %29
29: ; preds = %25
%30 = getelementptr inbounds i8, i8* %0, i64 7
%31 = tail call i32 @strcmp(i8* %30, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%32 = icmp eq i32 %31, 0
br i1 %32, label %41, label %33
33: ; preds = %29
%34 = getelementptr inbounds i8, i8* %0, i64 8
%35 = tail call i32 @strcmp(i8* %34, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%36 = icmp eq i32 %35, 0
br i1 %36, label %41, label %37
37: ; preds = %33
%38 = getelementptr inbounds i8, i8* %0, i64 9
%39 = tail call i32 @strcmp(i8* %38, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %37, %33, %29, %25, %21
%42 = tail call i32 @log_all(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0))
br label %92
43: ; preds = %37
%44 = tail call i8* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%45 = icmp eq i8* %44, null
br i1 %45, label %90, label %46
46: ; preds = %43
%47 = tail call dereferenceable_or_null(8) i8* @malloc(i32 8)
%48 = getelementptr inbounds i8, i8* %44, i64 4
%49 = load i8, i8* %48
%50 = icmp eq i8 %49, 32
br i1 %50, label %87, label %51
51: ; preds = %46
store i8 %49, i8* %47
%52 = getelementptr inbounds i8, i8* %44, i64 5
%53 = load i8, i8* %52
%54 = icmp eq i8 %53, 32
br i1 %54, label %87, label %55
55: ; preds = %51
%56 = getelementptr inbounds i8, i8* %47, i64 1
store i8 %53, i8* %56
%57 = getelementptr inbounds i8, i8* %44, i64 6
%58 = load i8, i8* %57
%59 = icmp eq i8 %58, 32
br i1 %59, label %87, label %60
60: ; preds = %55
%61 = getelementptr inbounds i8, i8* %47, i64 2
store i8 %58, i8* %61
%62 = getelementptr inbounds i8, i8* %44, i64 7
%63 = load i8, i8* %62
%64 = icmp eq i8 %63, 32
br i1 %64, label %87, label %65
65: ; preds = %60
%66 = getelementptr inbounds i8, i8* %47, i64 3
store i8 %63, i8* %66
%67 = getelementptr inbounds i8, i8* %44, i64 8
%68 = load i8, i8* %67
%69 = icmp eq i8 %68, 32
br i1 %69, label %87, label %70
70: ; preds = %65
%71 = getelementptr inbounds i8, i8* %47, i64 4
store i8 %68, i8* %71
%72 = getelementptr inbounds i8, i8* %44, i64 9
%73 = load i8, i8* %72
%74 = icmp eq i8 %73, 32
br i1 %74, label %87, label %75
75: ; preds = %70
%76 = getelementptr inbounds i8, i8* %47, i64 5
store i8 %73, i8* %76
%77 = getelementptr inbounds i8, i8* %44, i64 10
%78 = load i8, i8* %77
%79 = icmp eq i8 %78, 32
br i1 %79, label %87, label %80
80: ; preds = %75
%81 = getelementptr inbounds i8, i8* %47, i64 6
store i8 %78, i8* %81
%82 = getelementptr inbounds i8, i8* %44, i64 11
%83 = load i8, i8* %82
%84 = icmp eq i8 %83, 32
br i1 %84, label %87, label %85
85: ; preds = %80
%86 = getelementptr inbounds i8, i8* %47, i64 7
store i8 %83, i8* %86
br label %87
87: ; preds = %51, %55, %60, %65, %70, %75, %80, %85, %46
%88 = tail call i32 @strlen(i8* %47)
%89 = tail call i8* @realloc(i8* %47, i32 %88)
br label %92
90: ; preds = %43
%91 = tail call i32 @log_all(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0))
br label %92
92: ; preds = %87, %90, %41, %19, %5
%93 = phi i8* [ null, %5 ], [ null, %19 ], [ null, %41 ], [ %89, %87 ], [ null, %90 ]
ret i8* %93
}