#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*/ memmove(char *, char *, scalar_t__);
int /*<<< orphan*/ strcmp(char const *, char *);
scalar_t__ strlen(char *);
scalar_t__ strstr(char const *, char *);
void Info_RemoveKey(char *s, const char *key) {
  char *start;
  char pkey[1024];
  char value[1024];
  char *o;
  if (strstr(key, "\\")) {
    return;
  }
  while (1) {
    start = s;
    if (*s == '\\')
      s++;
    o = pkey;
    while (*s != '\\') {
      if (!*s)
        return;
      *o++ = *s++;
    }
    *o = 0;
    s++;
    o = value;
    while (*s != '\\' && *s) {
      if (!*s)
        return;
      *o++ = *s++;
    }
    *o = 0;
    if (!strcmp(key, pkey)) {
      memmove(start, s, strlen(s) + 1);
      return;
    }
    if (!*s)
      return;
  }
}


x86 assembly (clang, -O0):
<Info_RemoveKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x840,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1060 <strstr@plt>
cmp    $0x0,%rax
je     1172 <Info_RemoveKey+0x32>
jmp    1311 <Info_RemoveKey+0x1d1>
jmp    1177 <Info_RemoveKey+0x37>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    119b <Info_RemoveKey+0x5b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x828(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     11f8 <Info_RemoveKey+0xb8>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    11cb <Info_RemoveKey+0x8b>
jmp    1311 <Info_RemoveKey+0x1d1>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x828(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x828(%rbp)
mov    %cl,(%rax)
jmp    11a9 <Info_RemoveKey+0x69>
mov    -0x828(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
lea    -0x820(%rbp),%rax
mov    %rax,-0x828(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5c,%ecx
mov    %al,-0x829(%rbp)
je     1247 <Info_RemoveKey+0x107>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x829(%rbp)
mov    -0x829(%rbp),%al
test   $0x1,%al
jne    125a <Info_RemoveKey+0x11a>
jmp    1299 <Info_RemoveKey+0x159>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    126c <Info_RemoveKey+0x12c>
jmp    1311 <Info_RemoveKey+0x1d1>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x828(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x828(%rbp)
mov    %cl,(%rax)
jmp    121c <Info_RemoveKey+0xdc>
mov    -0x828(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x420(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12fa <Info_RemoveKey+0x1ba>
mov    -0x18(%rbp),%rax
mov    %rax,-0x840(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x838(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x840(%rbp),%rdi
mov    -0x838(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1050 <memmove@plt>
jmp    1311 <Info_RemoveKey+0x1d1>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    130c <Info_RemoveKey+0x1cc>
jmp    1311 <Info_RemoveKey+0x1d1>
jmp    1177 <Info_RemoveKey+0x37>
add    $0x840,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Info_RemoveKey>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xea3(%rip),%rsi
mov    %r14,%rdi
call   1060 <strstr@plt>
test   %rax,%rax
je     117b <Info_RemoveKey+0x3b>
add    $0x800,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    (%r15),%al
lea    0x400(%rsp),%r12
xor    %ebx,%ebx
cmp    $0x5c,%al
sete   %bl
add    %r15,%rbx
mov    %r12,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rbx),%ecx
test   %cl,%cl
je     116a <Info_RemoveKey+0x2a>
cmp    $0x5c,%cl
je     11c0 <Info_RemoveKey+0x80>
add    $0x1,%rbx
mov    %cl,(%rax)
add    $0x1,%rax
jmp    11a0 <Info_RemoveKey+0x60>
nopl   0x0(%rax,%rax,1)
movb   $0x0,(%rax)
mov    $0x1,%r13d
nopl   0x0(%rax)
movzbl (%rbx,%r13,1),%eax
test   %al,%al
je     11f0 <Info_RemoveKey+0xb0>
cmp    $0x5c,%al
je     11f0 <Info_RemoveKey+0xb0>
mov    %al,-0x1(%rsp,%r13,1)
add    $0x1,%r13
jmp    11d0 <Info_RemoveKey+0x90>
nopl   0x0(%rax,%rax,1)
movb   $0x0,-0x1(%rsp,%r13,1)
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <strcmp@plt>
add    %r13,%rbx
test   %eax,%eax
je     121a <Info_RemoveKey+0xda>
mov    (%rbx),%al
mov    %rbx,%r15
test   %al,%al
jne    1186 <Info_RemoveKey+0x46>
jmp    116a <Info_RemoveKey+0x2a>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r15,%rdi
mov    %rbx,%rsi
add    $0x800,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1050 <memmove@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\\\00"
define void @Info_RemoveKey(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [1024 x i8]
%7 = alloca [1024 x i8]
%8 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %4
%10 = call i64 @strstr(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
br label %88
13: ; preds = %2
br label %14
14: ; preds = %13, %87
%15 = load i8*, i8** %3
store i8* %15, i8** %5
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 92
br i1 %19, label %20, label %23
20: ; preds = %14
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
br label %23
23: ; preds = %20, %14
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
store i8* %24, i8** %8
br label %25
25: ; preds = %35, %23
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 92
br i1 %29, label %30, label %41
30: ; preds = %25
%31 = load i8*, i8** %3
%32 = load i8, i8* %31
%33 = icmp ne i8 %32, 0
br i1 %33, label %35, label %34
34: ; preds = %30
br label %88
35: ; preds = %30
%36 = load i8*, i8** %3
%37 = getelementptr inbounds i8, i8* %36, i32 1
store i8* %37, i8** %3
%38 = load i8, i8* %36
%39 = load i8*, i8** %8
%40 = getelementptr inbounds i8, i8* %39, i32 1
store i8* %40, i8** %8
store i8 %38, i8* %39
br label %25
41: ; preds = %25
%42 = load i8*, i8** %8
store i8 0, i8* %42
%43 = load i8*, i8** %3
%44 = getelementptr inbounds i8, i8* %43, i32 1
store i8* %44, i8** %3
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
store i8* %45, i8** %8
br label %46
46: ; preds = %63, %41
%47 = load i8*, i8** %3
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp ne i32 %49, 92
br i1 %50, label %51, label %56
51: ; preds = %46
%52 = load i8*, i8** %3
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp ne i32 %54, 0
br label %56
56: ; preds = %51, %46
%57 = phi i1 [ false, %46 ], [ %55, %51 ]
br i1 %57, label %58, label %69
58: ; preds = %56
%59 = load i8*, i8** %3
%60 = load i8, i8* %59
%61 = icmp ne i8 %60, 0
br i1 %61, label %63, label %62
62: ; preds = %58
br label %88
63: ; preds = %58
%64 = load i8*, i8** %3
%65 = getelementptr inbounds i8, i8* %64, i32 1
store i8* %65, i8** %3
%66 = load i8, i8* %64
%67 = load i8*, i8** %8
%68 = getelementptr inbounds i8, i8* %67, i32 1
store i8* %68, i8** %8
store i8 %66, i8* %67
br label %46
69: ; preds = %56
%70 = load i8*, i8** %8
store i8 0, i8* %70
%71 = load i8*, i8** %4
%72 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%73 = call i32 @strcmp(i8* %71, i8* %72)
%74 = icmp ne i32 %73, 0
br i1 %74, label %82, label %75
75: ; preds = %69
%76 = load i8*, i8** %5
%77 = load i8*, i8** %3
%78 = load i8*, i8** %3
%79 = call i64 @strlen(i8* %78)
%80 = add nsw i64 %79, 1
%81 = call i32 @memmove(i8* %76, i8* %77, i64 %80)
br label %88
82: ; preds = %69
%83 = load i8*, i8** %3
%84 = load i8, i8* %83
%85 = icmp ne i8 %84, 0
br i1 %85, label %87, label %86
86: ; preds = %82
br label %88
87: ; preds = %82
br label %14
88: ; preds = %86, %75, %62, %34, %12
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\\\00"
define void @Info_RemoveKey(i8* %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = tail call i64 @strstr(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %42
9: ; preds = %2
%10 = load i8, i8* %0
br label %11
11: ; preds = %9, %39
%12 = phi i8 [ %40, %39 ], [ %10, %9 ]
%13 = phi i8* [ %28, %39 ], [ %0, %9 ]
%14 = icmp eq i8 %12, 92
%15 = zext i1 %14 to i64
%16 = getelementptr i8, i8* %13, i64 %15
br label %17
17: ; preds = %21, %11
%18 = phi i8* [ %16, %11 ], [ %22, %21 ]
%19 = phi i8* [ %5, %11 ], [ %23, %21 ]
%20 = load i8, i8* %18
switch i8 %20, label %21 [
i8 92, label %24
i8 0, label %42
]
21: ; preds = %17
%22 = getelementptr inbounds i8, i8* %18, i64 1
%23 = getelementptr inbounds i8, i8* %19, i64 1
store i8 %20, i8* %19
br label %17
24: ; preds = %17
store i8 0, i8* %19
br label %25
25: ; preds = %30, %24
%26 = phi i8* [ %18, %24 ], [ %28, %30 ]
%27 = phi i8* [ %6, %24 ], [ %31, %30 ]
%28 = getelementptr inbounds i8, i8* %26, i64 1
%29 = load i8, i8* %28
switch i8 %29, label %30 [
i8 92, label %32
i8 0, label %32
]
30: ; preds = %25
%31 = getelementptr inbounds i8, i8* %27, i64 1
store i8 %29, i8* %27
br label %25
32: ; preds = %25, %25
store i8 0, i8* %27
%33 = call i32 @strcmp(i8* dereferenceable(1) %1, i8* %5)
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %32
%36 = tail call i64 @strlen(i8* %28)
%37 = add nsw i64 %36, 1
%38 = tail call i32 @memmove(i8* %13, i8* %28, i64 %37)
br label %42
39: ; preds = %32
%40 = load i8, i8* %28
%41 = icmp eq i8 %40, 0
br i1 %41, label %42, label %11
42: ; preds = %39, %17, %2, %35
ret void
}