#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*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strstr(char *, char *);
void Info_RemoveKey(char *s, char *key) {
  char *start;
  char pkey[512];
  char value[512];
  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)) {
      strcpy(start, s);
      return;
    }
    if (!*s)
      return;
  }
}


x86 assembly (clang, -O0):
<Info_RemoveKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     1162 <Info_RemoveKey+0x32>
jmp    12d5 <Info_RemoveKey+0x1a5>
jmp    1167 <Info_RemoveKey+0x37>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    118b <Info_RemoveKey+0x5b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
lea    -0x220(%rbp),%rax
mov    %rax,-0x428(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     11e8 <Info_RemoveKey+0xb8>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    11bb <Info_RemoveKey+0x8b>
jmp    12d5 <Info_RemoveKey+0x1a5>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x428(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x428(%rbp)
mov    %cl,(%rax)
jmp    1199 <Info_RemoveKey+0x69>
mov    -0x428(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x428(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5c,%ecx
mov    %al,-0x429(%rbp)
je     1237 <Info_RemoveKey+0x107>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x429(%rbp)
mov    -0x429(%rbp),%al
test   $0x1,%al
jne    124a <Info_RemoveKey+0x11a>
jmp    1289 <Info_RemoveKey+0x159>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    125c <Info_RemoveKey+0x12c>
jmp    12d5 <Info_RemoveKey+0x1a5>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x428(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x428(%rbp)
mov    %cl,(%rax)
jmp    120c <Info_RemoveKey+0xdc>
mov    -0x428(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x220(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12be <Info_RemoveKey+0x18e>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    12d5 <Info_RemoveKey+0x1a5>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    12d0 <Info_RemoveKey+0x1a0>
jmp    12d5 <Info_RemoveKey+0x1a5>
jmp    1167 <Info_RemoveKey+0x37>
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Info_RemoveKey>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%r14
mov    %rdi,%r12
lea    0xeb3(%rip),%rsi
mov    %r14,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     116b <Info_RemoveKey+0x3b>
add    $0x400,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    (%r12),%al
lea    0x200(%rsp),%r15
xor    %ebx,%ebx
cmp    $0x5c,%al
sete   %bl
add    %r12,%rbx
mov    %r15,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%ecx
test   %cl,%cl
je     115a <Info_RemoveKey+0x2a>
cmp    $0x5c,%cl
je     11b0 <Info_RemoveKey+0x80>
add    $0x1,%rbx
mov    %cl,(%rax)
add    $0x1,%rax
jmp    1190 <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     11e0 <Info_RemoveKey+0xb0>
cmp    $0x5c,%al
je     11e0 <Info_RemoveKey+0xb0>
mov    %al,-0x1(%rsp,%r13,1)
add    $0x1,%r13
jmp    11c0 <Info_RemoveKey+0x90>
nopl   0x0(%rax,%rax,1)
movb   $0x0,-0x1(%rsp,%r13,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
add    %r13,%rbx
test   %eax,%eax
je     120a <Info_RemoveKey+0xda>
mov    (%rbx),%al
mov    %rbx,%r12
test   %al,%al
jne    1177 <Info_RemoveKey+0x47>
jmp    115a <Info_RemoveKey+0x2a>
mov    %r12,%rdi
mov    %rbx,%rsi
add    $0x400,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <strcpy@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 [512 x i8]
%7 = alloca [512 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 %85
13: ; preds = %2
br label %14
14: ; preds = %13, %84
%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 [512 x i8], [512 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 %85
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 [512 x i8], [512 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 %85
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 [512 x i8], [512 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 %79, label %75
75: ; preds = %69
%76 = load i8*, i8** %5
%77 = load i8*, i8** %3
%78 = call i32 @strcpy(i8* %76, i8* %77)
br label %85
79: ; preds = %69
%80 = load i8*, i8** %3
%81 = load i8, i8* %80
%82 = icmp ne i8 %81, 0
br i1 %82, label %84, label %83
83: ; preds = %79
br label %85
84: ; preds = %79
br label %14
85: ; preds = %83, %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 [512 x i8]
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [512 x i8], [512 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 %40
9: ; preds = %2
%10 = load i8, i8* %0
br label %11
11: ; preds = %9, %37
%12 = phi i8 [ %38, %37 ], [ %10, %9 ]
%13 = phi i8* [ %28, %37 ], [ %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 %40
]
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 %37
35: ; preds = %32
%36 = tail call i32 @strcpy(i8* %13, i8* %28)
br label %40
37: ; preds = %32
%38 = load i8, i8* %28
%39 = icmp eq i8 %38, 0
br i1 %39, label %40, label %11
40: ; preds = %37, %17, %2, %35
ret void
}