#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*/ cBuffer;

/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
int /*<<< orphan*/ strcmp(char *, char *);
char *strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
char *strrchr(char *, char);
char *removeDotSegments(char *pcPath) {
  char cBuffer[4096] = "";
  char *d = cBuffer, *s = pcPath;
  if (pcPath) {
    if (strlen(pcPath) >= sizeof(cBuffer)) {
      return NULL;
    }
    while (*s) {
      if (!strncmp(s, "./", 2)) {
        memmove(s, s + 2, strlen(s + 2) + 1);
        continue;
      }
      if (!strncmp(s, "../", 3)) {
        memmove(s, s + 3, strlen(s + 3) + 1);
        continue;
      }
      if (!strcmp(s, "/.")) {
        s[1] = '\0';
      }
      if (!strncmp(s, "/./", 3)) {
        memmove(s, s + 2, strlen(s + 2) + 1);
        continue;
      }
      if (!strcmp(s, "/..")) {
        s[1] = '\0';
        if (!(d = strrchr(cBuffer, '/'))) {
          d = cBuffer;
        }
        *d = '\0';
        continue;
      }
      if (!strncmp(s, "/../", 4)) {
        memmove(s, s + 3, strlen(s + 3) + 1);
        if (!(d = strrchr(cBuffer, '/'))) {
          d = cBuffer;
        }
        *d = '\0';
        continue;
      }
      if (!strcmp(pcPath, ".") || !strcmp(pcPath, "..")) {
        *pcPath = '\0';
        return pcPath;
      }
      *d++ = *s++;
      while (*s && *s != '/')
        *d++ = *s++;
      *d = '\0';
    }
    return strcpy(pcPath, cBuffer);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<removeDotSegments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1070,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x1010(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1070 <memset@plt>
lea    -0x1010(%rbp),%rax
mov    %rax,-0x1018(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x1020(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1581 <removeDotSegments+0x411>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
cltq
cmp    $0x1000,%rax
jb     11da <removeDotSegments+0x6a>
movq   $0x0,-0x8(%rbp)
jmp    1589 <removeDotSegments+0x419>
jmp    11df <removeDotSegments+0x6f>
mov    -0x1020(%rbp),%rax
cmpb   $0x0,(%rax)
je     1568 <removeDotSegments+0x3f8>
mov    -0x1020(%rbp),%rdi
lea    0xe10(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    125d <removeDotSegments+0xed>
mov    -0x1020(%rbp),%rax
mov    %rax,-0x1030(%rbp)
mov    -0x1020(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x1028(%rbp)
mov    -0x1020(%rbp),%rdi
add    $0x2,%rdi
call   1050 <strlen@plt>
mov    -0x1030(%rbp),%rdi
mov    -0x1028(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   1090 <memmove@plt>
jmp    11df <removeDotSegments+0x6f>
mov    -0x1020(%rbp),%rdi
lea    0xda1(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    12cb <removeDotSegments+0x15b>
mov    -0x1020(%rbp),%rax
mov    %rax,-0x1040(%rbp)
mov    -0x1020(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x1038(%rbp)
mov    -0x1020(%rbp),%rdi
add    $0x3,%rdi
call   1050 <strlen@plt>
mov    -0x1040(%rbp),%rdi
mov    -0x1038(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   1090 <memmove@plt>
jmp    11df <removeDotSegments+0x6f>
mov    -0x1020(%rbp),%rdi
lea    0xd27(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    12f2 <removeDotSegments+0x182>
mov    -0x1020(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x1020(%rbp),%rdi
lea    0xd03(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1360 <removeDotSegments+0x1f0>
mov    -0x1020(%rbp),%rax
mov    %rax,-0x1050(%rbp)
mov    -0x1020(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x1048(%rbp)
mov    -0x1020(%rbp),%rdi
add    $0x2,%rdi
call   1050 <strlen@plt>
mov    -0x1050(%rbp),%rdi
mov    -0x1048(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   1090 <memmove@plt>
jmp    11df <removeDotSegments+0x6f>
mov    -0x1020(%rbp),%rdi
lea    0xc99(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    13c6 <removeDotSegments+0x256>
mov    -0x1020(%rbp),%rax
movb   $0x0,0x1(%rax)
lea    -0x1010(%rbp),%rdi
mov    $0x2f,%esi
call   1060 <strrchr@plt>
mov    %rax,-0x1018(%rbp)
cmp    $0x0,%rax
jne    13b7 <removeDotSegments+0x247>
lea    -0x1010(%rbp),%rax
mov    %rax,-0x1018(%rbp)
mov    -0x1018(%rbp),%rax
movb   $0x0,(%rax)
jmp    11df <removeDotSegments+0x6f>
mov    -0x1020(%rbp),%rdi
lea    0xc37(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    146e <removeDotSegments+0x2fe>
mov    -0x1020(%rbp),%rax
mov    %rax,-0x1060(%rbp)
mov    -0x1020(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x1058(%rbp)
mov    -0x1020(%rbp),%rdi
add    $0x3,%rdi
call   1050 <strlen@plt>
mov    -0x1060(%rbp),%rdi
mov    -0x1058(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   1090 <memmove@plt>
lea    -0x1010(%rbp),%rdi
mov    $0x2f,%esi
call   1060 <strrchr@plt>
mov    %rax,-0x1018(%rbp)
cmp    $0x0,%rax
jne    145f <removeDotSegments+0x2ef>
lea    -0x1010(%rbp),%rax
mov    %rax,-0x1018(%rbp)
mov    -0x1018(%rbp),%rax
movb   $0x0,(%rax)
jmp    11df <removeDotSegments+0x6f>
mov    -0x10(%rbp),%rdi
lea    0xb90(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
je     14a0 <removeDotSegments+0x330>
mov    -0x10(%rbp),%rdi
lea    0xb76(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    14b4 <removeDotSegments+0x344>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1589 <removeDotSegments+0x419>
mov    -0x1020(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x1020(%rbp)
mov    (%rax),%cl
mov    -0x1018(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x1018(%rbp)
mov    %cl,(%rax)
mov    -0x1020(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1061(%rbp)
je     1513 <removeDotSegments+0x3a3>
mov    -0x1020(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
setne  %al
mov    %al,-0x1061(%rbp)
mov    -0x1061(%rbp),%al
test   $0x1,%al
jne    1526 <removeDotSegments+0x3b6>
jmp    1559 <removeDotSegments+0x3e9>
mov    -0x1020(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x1020(%rbp)
mov    (%rax),%cl
mov    -0x1018(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x1018(%rbp)
mov    %cl,(%rax)
jmp    14e2 <removeDotSegments+0x372>
mov    -0x1018(%rbp),%rax
movb   $0x0,(%rax)
jmp    11df <removeDotSegments+0x6f>
mov    -0x10(%rbp),%rdi
lea    -0x1010(%rbp),%rsi
call   1040 <strcpy@plt>
mov    %rax,-0x8(%rbp)
jmp    1589 <removeDotSegments+0x419>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1070,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeDotSegments>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1018,%rsp
mov    %rdi,%r14
lea    0x10(%rsp),%rdi
mov    $0x1000,%edx
xor    %esi,%esi
call   1070 <memset@plt>
test   %r14,%r14
je     11a9 <removeDotSegments+0x39>
mov    %r14,%rdi
call   1050 <strlen@plt>
cmp    $0xfff,%eax
jbe    11b1 <removeDotSegments+0x41>
xor    %r14d,%r14d
jmp    132e <removeDotSegments+0x1be>
cmpb   $0x0,(%r14)
je     1321 <removeDotSegments+0x1b1>
lea    0xe4b(%rip),%r15
mov    %r14,%rbx
lea    0x10(%rsp),%rax
mov    %rax,0x8(%rsp)
lea    0x2(%rbx),%r12
lea    0x3(%rbx),%rbp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
mov    %r12,%r13
test   %eax,%eax
je     1244 <removeDotSegments+0xd4>
mov    %rbx,%rdi
lea    0xe0b(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
mov    %rbp,%r13
test   %eax,%eax
je     1244 <removeDotSegments+0xd4>
mov    %rbx,%rdi
lea    0xde4(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
jne    1229 <removeDotSegments+0xb9>
movb   $0x0,0x1(%rbx)
mov    %rbx,%rdi
lea    0xdd0(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
mov    %r12,%r13
test   %eax,%eax
jne    1264 <removeDotSegments+0xf4>
mov    %r13,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    %r13,%rsi
call   1090 <memmove@plt>
cmpb   $0x0,(%rbx)
jne    11e0 <removeDotSegments+0x70>
jmp    1321 <removeDotSegments+0x1b1>
mov    %rbx,%rdi
lea    0xd99(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
je     12a7 <removeDotSegments+0x137>
mov    %rbx,%rdi
lea    0xd8a(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    12ce <removeDotSegments+0x15e>
mov    %rbp,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <memmove@plt>
jmp    12ab <removeDotSegments+0x13b>
movb   $0x0,0x1(%rbx)
lea    0x10(%rsp),%r13
mov    %r13,%rdi
mov    $0x2f,%esi
call   1060 <strrchr@plt>
test   %rax,%rax
cmove  %r13,%rax
mov    %rax,0x8(%rsp)
movb   $0x0,(%rax)
jmp    125a <removeDotSegments+0xea>
mov    %r14,%rdi
lea    0xd31(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
je     1343 <removeDotSegments+0x1d3>
mov    %r14,%rdi
lea    0xd1d(%rip),%rsi
call   1080 <strcmp@plt>
test   %eax,%eax
je     1343 <removeDotSegments+0x1d3>
mov    (%rbx),%al
mov    0x8(%rsp),%rcx
mov    %al,(%rcx)
add    $0x1,%rcx
add    $0x1,%rbx
movzbl (%rbx),%eax
test   %al,%al
je     1310 <removeDotSegments+0x1a0>
cmp    $0x2f,%al
jne    12fb <removeDotSegments+0x18b>
mov    %rcx,0x8(%rsp)
movb   $0x0,(%rcx)
cmpb   $0x0,(%rbx)
jne    11cf <removeDotSegments+0x5f>
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   1040 <strcpy@plt>
mov    %r14,%rax
add    $0x1018,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movb   $0x0,(%r14)
jmp    132e <removeDotSegments+0x1be>

LLVM IR (-O0):
@.str = [3 x i8] c"./\00"
@.str.1 = [4 x i8] c"../\00"
@.str.2 = [3 x i8] c"/.\00"
@.str.3 = [4 x i8] c"/./\00"
@.str.4 = [4 x i8] c"/..\00"
@.str.5 = [5 x i8] c"/../\00"
@.str.6 = [2 x i8] c".\00"
@.str.7 = [3 x i8] c"..\00"
define i8* @removeDotSegments(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [4096 x i8]
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
%7 = bitcast [4096 x i8]* %4 to i8*
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
store i8* %8, i8** %5
%9 = load i8*, i8** %3
store i8* %9, i8** %6
%10 = load i8*, i8** %3
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %144
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i32 @strlen(i8* %13)
%15 = sext i32 %14 to i64
%16 = icmp uge i64 %15, 4096
br i1 %16, label %17, label %18
17: ; preds = %12
store i8* null, i8** %2
br label %145
18: ; preds = %12
br label %19
19: ; preds = %138, %101, %81, %60, %40, %27, %18
%20 = load i8*, i8** %6
%21 = load i8, i8* %20
%22 = icmp ne i8 %21, 0
br i1 %22, label %23, label %140
23: ; preds = %19
%24 = load i8*, i8** %6
%25 = call i32 @strncmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%26 = icmp ne i32 %25, 0
br i1 %26, label %36, label %27
27: ; preds = %23
%28 = load i8*, i8** %6
%29 = load i8*, i8** %6
%30 = getelementptr inbounds i8, i8* %29, i64 2
%31 = load i8*, i8** %6
%32 = getelementptr inbounds i8, i8* %31, i64 2
%33 = call i32 @strlen(i8* %32)
%34 = add nsw i32 %33, 1
%35 = call i32 @memmove(i8* %28, i8* %30, i32 %34)
br label %19
36: ; preds = %23
%37 = load i8*, i8** %6
%38 = call i32 @strncmp(i8* %37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%39 = icmp ne i32 %38, 0
br i1 %39, label %49, label %40
40: ; preds = %36
%41 = load i8*, i8** %6
%42 = load i8*, i8** %6
%43 = getelementptr inbounds i8, i8* %42, i64 3
%44 = load i8*, i8** %6
%45 = getelementptr inbounds i8, i8* %44, i64 3
%46 = call i32 @strlen(i8* %45)
%47 = add nsw i32 %46, 1
%48 = call i32 @memmove(i8* %41, i8* %43, i32 %47)
br label %19
49: ; preds = %36
%50 = load i8*, i8** %6
%51 = call i32 @strcmp(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%52 = icmp ne i32 %51, 0
br i1 %52, label %56, label %53
53: ; preds = %49
%54 = load i8*, i8** %6
%55 = getelementptr inbounds i8, i8* %54, i64 1
store i8 0, i8* %55
br label %56
56: ; preds = %53, %49
%57 = load i8*, i8** %6
%58 = call i32 @strncmp(i8* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%59 = icmp ne i32 %58, 0
br i1 %59, label %69, label %60
60: ; preds = %56
%61 = load i8*, i8** %6
%62 = load i8*, i8** %6
%63 = getelementptr inbounds i8, i8* %62, i64 2
%64 = load i8*, i8** %6
%65 = getelementptr inbounds i8, i8* %64, i64 2
%66 = call i32 @strlen(i8* %65)
%67 = add nsw i32 %66, 1
%68 = call i32 @memmove(i8* %61, i8* %63, i32 %67)
br label %19
69: ; preds = %56
%70 = load i8*, i8** %6
%71 = call i32 @strcmp(i8* %70, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%72 = icmp ne i32 %71, 0
br i1 %72, label %83, label %73
73: ; preds = %69
%74 = load i8*, i8** %6
%75 = getelementptr inbounds i8, i8* %74, i64 1
store i8 0, i8* %75
%76 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%77 = call i8* @strrchr(i8* %76, i8 signext 47)
store i8* %77, i8** %5
%78 = icmp ne i8* %77, null
br i1 %78, label %81, label %79
79: ; preds = %73
%80 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
store i8* %80, i8** %5
br label %81
81: ; preds = %79, %73
%82 = load i8*, i8** %5
store i8 0, i8* %82
br label %19
83: ; preds = %69
%84 = load i8*, i8** %6
%85 = call i32 @strncmp(i8* %84, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%86 = icmp ne i32 %85, 0
br i1 %86, label %103, label %87
87: ; preds = %83
%88 = load i8*, i8** %6
%89 = load i8*, i8** %6
%90 = getelementptr inbounds i8, i8* %89, i64 3
%91 = load i8*, i8** %6
%92 = getelementptr inbounds i8, i8* %91, i64 3
%93 = call i32 @strlen(i8* %92)
%94 = add nsw i32 %93, 1
%95 = call i32 @memmove(i8* %88, i8* %90, i32 %94)
%96 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%97 = call i8* @strrchr(i8* %96, i8 signext 47)
store i8* %97, i8** %5
%98 = icmp ne i8* %97, null
br i1 %98, label %101, label %99
99: ; preds = %87
%100 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
store i8* %100, i8** %5
br label %101
101: ; preds = %99, %87
%102 = load i8*, i8** %5
store i8 0, i8* %102
br label %19
103: ; preds = %83
%104 = load i8*, i8** %3
%105 = call i32 @strcmp(i8* %104, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%106 = icmp ne i32 %105, 0
br i1 %106, label %107, label %111
107: ; preds = %103
%108 = load i8*, i8** %3
%109 = call i32 @strcmp(i8* %108, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%110 = icmp ne i32 %109, 0
br i1 %110, label %114, label %111
111: ; preds = %107, %103
%112 = load i8*, i8** %3
store i8 0, i8* %112
%113 = load i8*, i8** %3
store i8* %113, i8** %2
br label %145
114: ; preds = %107
%115 = load i8*, i8** %6
%116 = getelementptr inbounds i8, i8* %115, i32 1
store i8* %116, i8** %6
%117 = load i8, i8* %115
%118 = load i8*, i8** %5
%119 = getelementptr inbounds i8, i8* %118, i32 1
store i8* %119, i8** %5
store i8 %117, i8* %118
br label %120
120: ; preds = %132, %114
%121 = load i8*, i8** %6
%122 = load i8, i8* %121
%123 = sext i8 %122 to i32
%124 = icmp ne i32 %123, 0
br i1 %124, label %125, label %130
125: ; preds = %120
%126 = load i8*, i8** %6
%127 = load i8, i8* %126
%128 = sext i8 %127 to i32
%129 = icmp ne i32 %128, 47
br label %130
130: ; preds = %125, %120
%131 = phi i1 [ false, %120 ], [ %129, %125 ]
br i1 %131, label %132, label %138
132: ; preds = %130
%133 = load i8*, i8** %6
%134 = getelementptr inbounds i8, i8* %133, i32 1
store i8* %134, i8** %6
%135 = load i8, i8* %133
%136 = load i8*, i8** %5
%137 = getelementptr inbounds i8, i8* %136, i32 1
store i8* %137, i8** %5
store i8 %135, i8* %136
br label %120
138: ; preds = %130
%139 = load i8*, i8** %5
store i8 0, i8* %139
br label %19
140: ; preds = %19
%141 = load i8*, i8** %3
%142 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%143 = call i8* @strcpy(i8* %141, i8* %142)
store i8* %143, i8** %2
br label %145
144: ; preds = %1
store i8* null, i8** %2
br label %145
145: ; preds = %144, %140, %111, %17
%146 = load i8*, i8** %2
ret i8* %146
}

LLVM IR (-O2):
@.str = [3 x i8] c"./\00"
@.str.1 = [4 x i8] c"../\00"
@.str.2 = [3 x i8] c"/.\00"
@.str.3 = [4 x i8] c"/./\00"
@.str.4 = [4 x i8] c"/..\00"
@.str.5 = [5 x i8] c"/../\00"
@.str.6 = [2 x i8] c".\00"
@.str.7 = [3 x i8] c"..\00"
define i8* @removeDotSegments(i8* %0) {
%2 = alloca [4096 x i8]
%3 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%4 = icmp eq i8* %0, null
br i1 %4, label %77, label %5
5: ; preds = %1
%6 = tail call i32 @strlen(i8* %0)
%7 = icmp ugt i32 %6, 4095
br i1 %7, label %77, label %8
8: ; preds = %5
%9 = load i8, i8* %0
%10 = icmp eq i8 %9, 0
br i1 %10, label %75, label %11
11: ; preds = %8, %72
%12 = phi i8* [ %69, %72 ], [ %0, %8 ]
%13 = phi i8* [ %68, %72 ], [ %3, %8 ]
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = getelementptr inbounds i8, i8* %12, i64 2
%16 = getelementptr inbounds i8, i8* %12, i64 3
br label %17
17: ; preds = %11, %50
%18 = phi i8* [ %13, %11 ], [ %53, %50 ]
br label %19
19: ; preds = %17, %22
%20 = call i32 @strncmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %19, %36, %29
%23 = phi i8* [ %16, %29 ], [ %15, %36 ], [ %15, %19 ]
%24 = call i32 @strlen(i8* %23)
%25 = add nsw i32 %24, 1
%26 = call i32 @memmove(i8* %12, i8* %23, i32 %25)
%27 = load i8, i8* %12
%28 = icmp eq i8 %27, 0
br i1 %28, label %75, label %19
29: ; preds = %19
%30 = call i32 @strncmp(i8* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%31 = icmp eq i32 %30, 0
br i1 %31, label %22, label %32
32: ; preds = %29
%33 = call i32 @strcmp(i8* %12, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %32
store i8 0, i8* %14
br label %36
36: ; preds = %35, %32
%37 = call i32 @strncmp(i8* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%38 = icmp eq i32 %37, 0
br i1 %38, label %22, label %39
39: ; preds = %36
%40 = call i32 @strcmp(i8* %12, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %39
store i8 0, i8* %14
br label %50
43: ; preds = %39
%44 = call i32 @strncmp(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 4)
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %56
46: ; preds = %43
%47 = call i32 @strlen(i8* %16)
%48 = add nsw i32 %47, 1
%49 = call i32 @memmove(i8* %12, i8* %16, i32 %48)
br label %50
50: ; preds = %46, %42
%51 = call i8* @strrchr(i8* %3, i8 signext 47)
%52 = icmp eq i8* %51, null
%53 = select i1 %52, i8* %3, i8* %51
store i8 0, i8* %53
%54 = load i8, i8* %12
%55 = icmp eq i8 %54, 0
br i1 %55, label %75, label %17
56: ; preds = %43
%57 = call i32 @strcmp(i8* %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%58 = icmp eq i32 %57, 0
br i1 %58, label %62, label %59
59: ; preds = %56
%60 = call i32 @strcmp(i8* %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %63
62: ; preds = %59, %56
store i8 0, i8* %0
br label %77
63: ; preds = %59
%64 = load i8, i8* %12
store i8 %64, i8* %18
br label %65
65: ; preds = %71, %63
%66 = phi i8* [ %18, %63 ], [ %68, %71 ]
%67 = phi i8* [ %12, %63 ], [ %69, %71 ]
%68 = getelementptr inbounds i8, i8* %66, i64 1
%69 = getelementptr inbounds i8, i8* %67, i64 1
%70 = load i8, i8* %69
switch i8 %70, label %71 [
i8 0, label %72
i8 47, label %72
]
71: ; preds = %65
store i8 %70, i8* %68
br label %65
72: ; preds = %65, %65
store i8 0, i8* %68
%73 = load i8, i8* %69
%74 = icmp eq i8 %73, 0
br i1 %74, label %75, label %11
75: ; preds = %72, %50, %22, %8
%76 = call i8* @strcpy(i8* %0, i8* %3)
br label %77
77: ; preds = %1, %5, %75, %62
%78 = phi i8* [ %0, %62 ], [ %0, %75 ], [ null, %5 ], [ null, %1 ]
ret i8* %78
}