#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 *);
scalar_t__ isalnum(char);
scalar_t__ isspace(char);
char *malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
size_t strlen(char const *);
int /*<<< orphan*/ strncat(char *, char const *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strstr(char const *, char *);
char *myxml_find_xpath_first(const char *doc, const char *xpath) {
  char *attr, *pos, *p, *q;
  int size;
  if (!xpath)
    return NULL;
  if (!doc)
    return NULL;
  if ((strlen(xpath) < 3) || xpath[0] != '/' || xpath[1] != '/') {
    return NULL;
  }
  size = strlen(xpath);
  attr = malloc(size);
  if (attr == NULL)
    return NULL;
  memset(attr, 0, size);
  strncpy(attr, "<", size);
  strncat(attr, &xpath[2], size);
  pos = strstr(doc, attr);
  while (pos) {
    p = &pos[strlen(attr)];
    if (isspace(p[0]) || p[0] == '/' || p[0] == '>') {
      free(attr);
      return pos;
    }
    pos = strstr(p, attr);
  }
  strncpy(attr, ":", size);
  strncat(attr, &xpath[2], size);
  pos = strstr(doc, attr);
  while (pos) {
    p = &pos[strlen(attr)];
    if (isspace(p[0]) || p[0] == '/' || p[0] == '>') {
      q = pos;
      while ((q != doc) && (*q != '<')) {
        q--;
        if (*q == '<') {
          free(attr);
          return q;
        }
        if (!(isalnum(*q) || *q == '_' || *q == '-')) {
          break;
        }
      }
    }
    pos = strstr(p, attr);
  }
  free(attr);
  return NULL;
}


x86 assembly (clang, -O0):
<myxml_find_xpath_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11b8 <myxml_find_xpath_first+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1484 <myxml_find_xpath_first+0x2f4>
cmpq   $0x0,-0x10(%rbp)
jne    11d0 <myxml_find_xpath_first+0x40>
movq   $0x0,-0x8(%rbp)
jmp    1484 <myxml_find_xpath_first+0x2f4>
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x3,%rax
jb     1204 <myxml_find_xpath_first+0x74>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1204 <myxml_find_xpath_first+0x74>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2f,%eax
je     1211 <myxml_find_xpath_first+0x81>
movq   $0x0,-0x8(%rbp)
jmp    1484 <myxml_find_xpath_first+0x2f4>
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%edi
call   10a0 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1241 <myxml_find_xpath_first+0xb1>
movq   $0x0,-0x8(%rbp)
jmp    1484 <myxml_find_xpath_first+0x2f4>
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%edx
lea    0xda3(%rip),%rsi
call   1040 <strncpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x2,%rsi
mov    -0x3c(%rbp),%edx
call   1080 <strncat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10b0 <strstr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1313 <myxml_find_xpath_first+0x183>
mov    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
jne    12e7 <myxml_find_xpath_first+0x157>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     12e7 <myxml_find_xpath_first+0x157>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3e,%eax
jne    12fd <myxml_find_xpath_first+0x16d>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1484 <myxml_find_xpath_first+0x2f4>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10b0 <strstr@plt>
mov    %rax,-0x28(%rbp)
jmp    1287 <myxml_find_xpath_first+0xf7>
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%edx
lea    0xce1(%rip),%rsi
call   1040 <strncpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x2,%rsi
mov    -0x3c(%rbp),%edx
call   1080 <strncat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10b0 <strstr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1473 <myxml_find_xpath_first+0x2e3>
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
jne    13ab <myxml_find_xpath_first+0x21b>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     13ab <myxml_find_xpath_first+0x21b>
mov    -0x30(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3e,%eax
jne    145d <myxml_find_xpath_first+0x2cd>
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x51(%rbp)
je     13d6 <myxml_find_xpath_first+0x246>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3c,%eax
setne  %al
mov    %al,-0x51(%rbp)
mov    -0x51(%rbp),%al
test   $0x1,%al
jne    13e6 <myxml_find_xpath_first+0x256>
jmp    1458 <myxml_find_xpath_first+0x2c8>
mov    -0x38(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3c,%eax
jne    1418 <myxml_find_xpath_first+0x288>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1484 <myxml_find_xpath_first+0x2f4>
mov    -0x38(%rbp),%rax
movsbl (%rax),%edi
call   1060 <isalnum@plt>
cmp    $0x0,%rax
jne    1453 <myxml_find_xpath_first+0x2c3>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
je     1453 <myxml_find_xpath_first+0x2c3>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1453 <myxml_find_xpath_first+0x2c3>
jmp    1458 <myxml_find_xpath_first+0x2c8>
jmp    13b3 <myxml_find_xpath_first+0x223>
jmp    145d <myxml_find_xpath_first+0x2cd>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10b0 <strstr@plt>
mov    %rax,-0x28(%rbp)
jmp    134b <myxml_find_xpath_first+0x1bb>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myxml_find_xpath_first>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r12d,%r12d
test   %rdi,%rdi
je     12c7 <myxml_find_xpath_first+0x137>
mov    %rsi,%rbx
test   %rsi,%rsi
je     12c7 <myxml_find_xpath_first+0x137>
mov    %rdi,%r15
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    $0x3,%rax
jb     12c4 <myxml_find_xpath_first+0x134>
cmpb   $0x2f,(%rbx)
jne    12c4 <myxml_find_xpath_first+0x134>
cmpb   $0x2f,0x1(%rbx)
jne    12c4 <myxml_find_xpath_first+0x134>
mov    %rax,%r13
mov    %r13d,%edi
call   10a0 <malloc@plt>
test   %rax,%rax
je     12c4 <myxml_find_xpath_first+0x134>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %r13d,%edx
call   1070 <memset@plt>
lea    0xdfa(%rip),%rsi
mov    %r14,%rdi
mov    %r13d,%edx
call   1040 <strncpy@plt>
add    $0x2,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r13d,%edx
call   1080 <strncat@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
je     1288 <myxml_find_xpath_first+0xf8>
mov    %rax,%r12
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %rax,%rbp
movsbl (%r12,%rax,1),%edi
call   1090 <isspace@plt>
test   %rax,%rax
jne    135d <myxml_find_xpath_first+0x1cd>
add    %r12,%rbp
movzbl 0x0(%rbp),%eax
cmp    $0x2f,%al
je     135d <myxml_find_xpath_first+0x1cd>
cmp    $0x3e,%al
je     135d <myxml_find_xpath_first+0x1cd>
mov    %rbp,%rdi
mov    %r14,%rsi
call   10b0 <strstr@plt>
mov    %rax,%r12
test   %rax,%rax
jne    1240 <myxml_find_xpath_first+0xb0>
lea    0xd73(%rip),%rsi
mov    %r14,%rdi
mov    %r13d,%edx
call   1040 <strncpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r13d,%edx
call   1080 <strncat@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   10b0 <strstr@plt>
test   %rax,%rax
je     135a <myxml_find_xpath_first+0x1ca>
mov    %rax,%rbx
xor    %r12d,%r12d
jmp    12ec <myxml_find_xpath_first+0x15c>
xor    %r12d,%r12d
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r13,%rdi
mov    %r14,%rsi
call   10b0 <strstr@plt>
mov    %rax,%rbx
test   %rax,%rax
je     135d <myxml_find_xpath_first+0x1cd>
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    (%rbx,%rax,1),%r13
movsbl (%rbx,%rax,1),%edi
call   1090 <isspace@plt>
test   %rax,%rax
jne    1324 <myxml_find_xpath_first+0x194>
mov    0x0(%r13),%al
cmp    $0x3e,%al
je     1324 <myxml_find_xpath_first+0x194>
cmp    $0x2f,%al
je     1324 <myxml_find_xpath_first+0x194>
jmp    12d9 <myxml_find_xpath_first+0x149>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0xffffffffffffffff,%rbx
cmp    %r15,%rbx
je     12d9 <myxml_find_xpath_first+0x149>
cmpb   $0x3c,(%rbx)
je     12d9 <myxml_find_xpath_first+0x149>
movzbl -0x1(%rbx),%eax
cmp    $0x3c,%al
je     1351 <myxml_find_xpath_first+0x1c1>
movsbl %al,%edi
call   1060 <isalnum@plt>
test   %rax,%rax
jne    1320 <myxml_find_xpath_first+0x190>
movzbl -0x1(%rbx),%eax
cmp    $0x5f,%al
je     1320 <myxml_find_xpath_first+0x190>
cmp    $0x2d,%al
je     1320 <myxml_find_xpath_first+0x190>
jmp    12d9 <myxml_find_xpath_first+0x149>
add    $0xffffffffffffffff,%rbx
mov    %rbx,%r12
jmp    135d <myxml_find_xpath_first+0x1cd>
xor    %r12d,%r12d
mov    %r14,%rdi
call   1030 <free@plt>
jmp    12c7 <myxml_find_xpath_first+0x137>

LLVM IR (-O0):
@.str = [2 x i8] c"<\00"
@.str.1 = [2 x i8] c":\00"
define i8* @myxml_find_xpath_first(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %2
store i8* null, i8** %3
br label %178
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = icmp ne i8* %15, null
br i1 %16, label %18, label %17
17: ; preds = %14
store i8* null, i8** %3
br label %178
18: ; preds = %14
%19 = load i8*, i8** %5
%20 = call i64 @strlen(i8* %19)
%21 = icmp ult i64 %20, 3
br i1 %21, label %34, label %22
22: ; preds = %18
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 47
br i1 %27, label %34, label %28
28: ; preds = %22
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 1
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 47
br i1 %33, label %34, label %35
34: ; preds = %28, %22, %18
store i8* null, i8** %3
br label %178
35: ; preds = %28
%36 = load i8*, i8** %5
%37 = call i64 @strlen(i8* %36)
%38 = trunc i64 %37 to i32
store i32 %38, i32* %10
%39 = load i32, i32* %10
%40 = call i8* @malloc(i32 %39)
store i8* %40, i8** %6
%41 = load i8*, i8** %6
%42 = icmp eq i8* %41, null
br i1 %42, label %43, label %44
43: ; preds = %35
store i8* null, i8** %3
br label %178
44: ; preds = %35
%45 = load i8*, i8** %6
%46 = load i32, i32* %10
%47 = call i32 @memset(i8* %45, i32 0, i32 %46)
%48 = load i8*, i8** %6
%49 = load i32, i32* %10
%50 = call i32 @strncpy(i8* %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %49)
%51 = load i8*, i8** %6
%52 = load i8*, i8** %5
%53 = getelementptr inbounds i8, i8* %52, i64 2
%54 = load i32, i32* %10
%55 = call i32 @strncat(i8* %51, i8* %53, i32 %54)
%56 = load i8*, i8** %4
%57 = load i8*, i8** %6
%58 = call i8* @strstr(i8* %56, i8* %57)
store i8* %58, i8** %7
br label %59
59: ; preds = %88, %44
%60 = load i8*, i8** %7
%61 = icmp ne i8* %60, null
br i1 %61, label %62, label %92
62: ; preds = %59
%63 = load i8*, i8** %7
%64 = load i8*, i8** %6
%65 = call i64 @strlen(i8* %64)
%66 = getelementptr inbounds i8, i8* %63, i64 %65
store i8* %66, i8** %8
%67 = load i8*, i8** %8
%68 = getelementptr inbounds i8, i8* %67, i64 0
%69 = load i8, i8* %68
%70 = call i64 @isspace(i8 signext %69)
%71 = icmp ne i64 %70, 0
br i1 %71, label %84, label %72
72: ; preds = %62
%73 = load i8*, i8** %8
%74 = getelementptr inbounds i8, i8* %73, i64 0
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp eq i32 %76, 47
br i1 %77, label %84, label %78
78: ; preds = %72
%79 = load i8*, i8** %8
%80 = getelementptr inbounds i8, i8* %79, i64 0
%81 = load i8, i8* %80
%82 = sext i8 %81 to i32
%83 = icmp eq i32 %82, 62
br i1 %83, label %84, label %88
84: ; preds = %78, %72, %62
%85 = load i8*, i8** %6
%86 = call i32 @free(i8* %85)
%87 = load i8*, i8** %7
store i8* %87, i8** %3
br label %178
88: ; preds = %78
%89 = load i8*, i8** %8
%90 = load i8*, i8** %6
%91 = call i8* @strstr(i8* %89, i8* %90)
store i8* %91, i8** %7
br label %59
92: ; preds = %59
%93 = load i8*, i8** %6
%94 = load i32, i32* %10
%95 = call i32 @strncpy(i8* %93, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %94)
%96 = load i8*, i8** %6
%97 = load i8*, i8** %5
%98 = getelementptr inbounds i8, i8* %97, i64 2
%99 = load i32, i32* %10
%100 = call i32 @strncat(i8* %96, i8* %98, i32 %99)
%101 = load i8*, i8** %4
%102 = load i8*, i8** %6
%103 = call i8* @strstr(i8* %101, i8* %102)
store i8* %103, i8** %7
br label %104
104: ; preds = %171, %92
%105 = load i8*, i8** %7
%106 = icmp ne i8* %105, null
br i1 %106, label %107, label %175
107: ; preds = %104
%108 = load i8*, i8** %7
%109 = load i8*, i8** %6
%110 = call i64 @strlen(i8* %109)
%111 = getelementptr inbounds i8, i8* %108, i64 %110
store i8* %111, i8** %8
%112 = load i8*, i8** %8
%113 = getelementptr inbounds i8, i8* %112, i64 0
%114 = load i8, i8* %113
%115 = call i64 @isspace(i8 signext %114)
%116 = icmp ne i64 %115, 0
br i1 %116, label %129, label %117
117: ; preds = %107
%118 = load i8*, i8** %8
%119 = getelementptr inbounds i8, i8* %118, i64 0
%120 = load i8, i8* %119
%121 = sext i8 %120 to i32
%122 = icmp eq i32 %121, 47
br i1 %122, label %129, label %123
123: ; preds = %117
%124 = load i8*, i8** %8
%125 = getelementptr inbounds i8, i8* %124, i64 0
%126 = load i8, i8* %125
%127 = sext i8 %126 to i32
%128 = icmp eq i32 %127, 62
br i1 %128, label %129, label %171
129: ; preds = %123, %117, %107
%130 = load i8*, i8** %7
store i8* %130, i8** %9
br label %131
131: ; preds = %169, %129
%132 = load i8*, i8** %9
%133 = load i8*, i8** %4
%134 = icmp ne i8* %132, %133
br i1 %134, label %135, label %140
135: ; preds = %131
%136 = load i8*, i8** %9
%137 = load i8, i8* %136
%138 = sext i8 %137 to i32
%139 = icmp ne i32 %138, 60
br label %140
140: ; preds = %135, %131
%141 = phi i1 [ false, %131 ], [ %139, %135 ]
br i1 %141, label %142, label %170
142: ; preds = %140
%143 = load i8*, i8** %9
%144 = getelementptr inbounds i8, i8* %143, i32 -1
store i8* %144, i8** %9
%145 = load i8*, i8** %9
%146 = load i8, i8* %145
%147 = sext i8 %146 to i32
%148 = icmp eq i32 %147, 60
br i1 %148, label %149, label %153
149: ; preds = %142
%150 = load i8*, i8** %6
%151 = call i32 @free(i8* %150)
%152 = load i8*, i8** %9
store i8* %152, i8** %3
br label %178
153: ; preds = %142
%154 = load i8*, i8** %9
%155 = load i8, i8* %154
%156 = call i64 @isalnum(i8 signext %155)
%157 = icmp ne i64 %156, 0
br i1 %157, label %169, label %158
158: ; preds = %153
%159 = load i8*, i8** %9
%160 = load i8, i8* %159
%161 = sext i8 %160 to i32
%162 = icmp eq i32 %161, 95
br i1 %162, label %169, label %163
163: ; preds = %158
%164 = load i8*, i8** %9
%165 = load i8, i8* %164
%166 = sext i8 %165 to i32
%167 = icmp eq i32 %166, 45
br i1 %167, label %169, label %168
168: ; preds = %163
br label %170
169: ; preds = %163, %158, %153
br label %131
170: ; preds = %168, %140
br label %171
171: ; preds = %170, %123
%172 = load i8*, i8** %8
%173 = load i8*, i8** %6
%174 = call i8* @strstr(i8* %172, i8* %173)
store i8* %174, i8** %7
br label %104
175: ; preds = %104
%176 = load i8*, i8** %6
%177 = call i32 @free(i8* %176)
store i8* null, i8** %3
br label %178
178: ; preds = %175, %149, %84, %43, %34, %17, %13
%179 = load i8*, i8** %3
ret i8* %179
}

LLVM IR (-O2):
@.str = [2 x i8] c"<\00"
@.str.1 = [2 x i8] c":\00"
define i8* @myxml_find_xpath_first(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = icmp eq i8* %0, null
%5 = or i1 %4, %3
br i1 %5, label %76, label %6
6: ; preds = %2
%7 = tail call i64 @strlen(i8* %1)
%8 = icmp ult i64 %7, 3
br i1 %8, label %76, label %9
9: ; preds = %6
%10 = load i8, i8* %1
%11 = icmp eq i8 %10, 47
br i1 %11, label %12, label %76
12: ; preds = %9
%13 = getelementptr inbounds i8, i8* %1, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 47
br i1 %15, label %16, label %76
16: ; preds = %12
%17 = trunc i64 %7 to i32
%18 = tail call i8* @malloc(i32 %17)
%19 = icmp eq i8* %18, null
br i1 %19, label %76, label %20
20: ; preds = %16
%21 = tail call i32 @memset(i8* %18, i32 0, i32 %17)
%22 = tail call i32 @strncpy(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %17)
%23 = getelementptr inbounds i8, i8* %1, i64 2
%24 = tail call i32 @strncat(i8* %18, i8* %23, i32 %17)
%25 = tail call i8* @strstr(i8* %0, i8* %18)
%26 = icmp eq i8* %25, null
br i1 %26, label %39, label %27
27: ; preds = %20, %36
%28 = phi i8* [ %37, %36 ], [ %25, %20 ]
%29 = tail call i64 @strlen(i8* %18)
%30 = getelementptr inbounds i8, i8* %28, i64 %29
%31 = load i8, i8* %30
%32 = tail call i64 @isspace(i8 signext %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %73
34: ; preds = %27
%35 = load i8, i8* %30
switch i8 %35, label %36 [
i8 47, label %73
i8 62, label %73
]
36: ; preds = %34
%37 = tail call i8* @strstr(i8* %30, i8* %18)
%38 = icmp eq i8* %37, null
br i1 %38, label %39, label %27
39: ; preds = %36, %20
%40 = tail call i32 @strncpy(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%41 = tail call i32 @strncat(i8* %18, i8* %23, i32 %17)
%42 = tail call i8* @strstr(i8* %0, i8* %18)
%43 = icmp eq i8* %42, null
br i1 %43, label %73, label %44
44: ; preds = %39, %70
%45 = phi i8* [ %71, %70 ], [ %42, %39 ]
%46 = tail call i64 @strlen(i8* %18)
%47 = getelementptr inbounds i8, i8* %45, i64 %46
%48 = load i8, i8* %47
%49 = tail call i64 @isspace(i8 signext %48)
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %44
%52 = load i8, i8* %47
switch i8 %52, label %70 [
i8 47, label %53
i8 62, label %53
]
53: ; preds = %51, %51, %44
%54 = icmp eq i8* %45, %0
br i1 %54, label %70, label %55
55: ; preds = %53, %68
%56 = phi i8* [ %60, %68 ], [ %45, %53 ]
%57 = load i8, i8* %56
%58 = icmp eq i8 %57, 60
br i1 %58, label %70, label %59
59: ; preds = %55
%60 = getelementptr inbounds i8, i8* %56, i64 -1
%61 = load i8, i8* %60
%62 = icmp eq i8 %61, 60
br i1 %62, label %73, label %63
63: ; preds = %59
%64 = tail call i64 @isalnum(i8 signext %61)
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %63
%67 = load i8, i8* %60
switch i8 %67, label %70 [
i8 95, label %68
i8 45, label %68
]
68: ; preds = %66, %66, %63
%69 = icmp eq i8* %60, %0
br i1 %69, label %70, label %55
70: ; preds = %68, %55, %66, %53, %51
%71 = tail call i8* @strstr(i8* %47, i8* %18)
%72 = icmp eq i8* %71, null
br i1 %72, label %73, label %44
73: ; preds = %27, %34, %34, %70, %59, %39
%74 = phi i8* [ null, %39 ], [ %60, %59 ], [ null, %70 ], [ %28, %34 ], [ %28, %34 ], [ %28, %27 ]
%75 = tail call i32 @free(i8* %18)
br label %76
76: ; preds = %73, %16, %6, %9, %12, %2
%77 = phi i8* [ null, %2 ], [ null, %12 ], [ null, %9 ], [ null, %6 ], [ null, %16 ], [ %74, %73 ]
ret i8* %77
}