#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 */
char *Info_FindKey(char *, char const *);
scalar_t__ Info_Validate(char *);
scalar_t__ Info_ValidateKey(char const *);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memmove(char *, char *, scalar_t__);
char *strchr(char *, char);
scalar_t__ strlen(char *);
void Info_RemoveKey(char *info, const char *key) {
  assert(info && Info_Validate(info));
  assert(key && Info_ValidateKey(key));
  if (!Info_Validate(info) || !Info_ValidateKey(key))
    return;
  while (1) {
    char *start, *p;
    p = Info_FindKey(info, key);
    if (!p)
      return;
    start = p;
    p++;
    p = strchr(p, '\\');
    if (p) {
      p++;
      p = strchr(p, '\\');
    }
    if (!p) {
      *start = 0;
    } else {
      memmove(start, p, strlen(p) + 1);
    }
  }
}


x86 assembly (clang, -O0):
<Info_RemoveKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x21(%rbp)
je     11a3 <Info_RemoveKey+0x33>
mov    -0x8(%rbp),%rdi
call   1030 <Info_Validate@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x22(%rbp)
je     11d3 <Info_RemoveKey+0x63>
mov    -0x10(%rbp),%rdi
call   1060 <Info_ValidateKey@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <Info_Validate@plt>
cmp    $0x0,%rax
je     1206 <Info_RemoveKey+0x96>
mov    -0x10(%rbp),%rdi
call   1060 <Info_ValidateKey@plt>
cmp    $0x0,%rax
jne    120b <Info_RemoveKey+0x9b>
jmp    12c9 <Info_RemoveKey+0x159>
jmp    1210 <Info_RemoveKey+0xa0>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1090 <Info_FindKey@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1231 <Info_RemoveKey+0xc1>
jmp    12c9 <Info_RemoveKey+0x159>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x5c,%esi
call   1050 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1280 <Info_RemoveKey+0x110>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x5c,%esi
call   1050 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1297 <Info_RemoveKey+0x127>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    12c4 <Info_RemoveKey+0x154>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1080 <memmove@plt>
jmp    1210 <Info_RemoveKey+0xa0>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Info_RemoveKey>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
mov    $0x0,%edi
test   %r15,%r15
je     119b <Info_RemoveKey+0x2b>
mov    %r15,%rdi
call   1030 <Info_Validate@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1070 <assert@plt>
test   %r14,%r14
je     11b5 <Info_RemoveKey+0x45>
mov    %r14,%rdi
call   1060 <Info_ValidateKey@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%edi
call   1070 <assert@plt>
mov    %r15,%rdi
call   1030 <Info_Validate@plt>
test   %rax,%rax
je     124b <Info_RemoveKey+0xdb>
mov    %r14,%rdi
call   1060 <Info_ValidateKey@plt>
test   %rax,%rax
je     124b <Info_RemoveKey+0xdb>
mov    %r15,%rdi
mov    %r14,%rsi
call   1090 <Info_FindKey@plt>
test   %rax,%rax
je     124b <Info_RemoveKey+0xdb>
mov    %rax,%rbx
jmp    1206 <Info_RemoveKey+0x96>
nop
movb   $0x0,(%rbx)
mov    %r15,%rdi
mov    %r14,%rsi
call   1090 <Info_FindKey@plt>
mov    %rax,%rbx
test   %rax,%rax
je     124b <Info_RemoveKey+0xdb>
lea    0x1(%rbx),%rdi
mov    $0x5c,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     11f0 <Info_RemoveKey+0x80>
add    $0x1,%rax
mov    %rax,%rdi
mov    $0x5c,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     11f0 <Info_RemoveKey+0x80>
mov    %rax,%r12
mov    %rax,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1080 <memmove@plt>
jmp    11f3 <Info_RemoveKey+0x83>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Info_RemoveKey(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i64 @Info_Validate(i8* %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %9, %2
%14 = phi i1 [ false, %2 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i8*, i8** %4
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %23
19: ; preds = %13
%20 = load i8*, i8** %4
%21 = call i64 @Info_ValidateKey(i8* %20)
%22 = icmp ne i64 %21, 0
br label %23
23: ; preds = %19, %13
%24 = phi i1 [ false, %13 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = load i8*, i8** %3
%28 = call i64 @Info_Validate(i8* %27)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %34
30: ; preds = %23
%31 = load i8*, i8** %4
%32 = call i64 @Info_ValidateKey(i8* %31)
%33 = icmp ne i64 %32, 0
br i1 %33, label %35, label %34
34: ; preds = %30, %23
br label %69
35: ; preds = %30
br label %36
36: ; preds = %35, %68
%37 = load i8*, i8** %3
%38 = load i8*, i8** %4
%39 = call i8* @Info_FindKey(i8* %37, i8* %38)
store i8* %39, i8** %6
%40 = load i8*, i8** %6
%41 = icmp ne i8* %40, null
br i1 %41, label %43, label %42
42: ; preds = %36
br label %69
43: ; preds = %36
%44 = load i8*, i8** %6
store i8* %44, i8** %5
%45 = load i8*, i8** %6
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %6
%47 = load i8*, i8** %6
%48 = call i8* @strchr(i8* %47, i8 signext 92)
store i8* %48, i8** %6
%49 = load i8*, i8** %6
%50 = icmp ne i8* %49, null
br i1 %50, label %51, label %56
51: ; preds = %43
%52 = load i8*, i8** %6
%53 = getelementptr inbounds i8, i8* %52, i32 1
store i8* %53, i8** %6
%54 = load i8*, i8** %6
%55 = call i8* @strchr(i8* %54, i8 signext 92)
store i8* %55, i8** %6
br label %56
56: ; preds = %51, %43
%57 = load i8*, i8** %6
%58 = icmp ne i8* %57, null
br i1 %58, label %61, label %59
59: ; preds = %56
%60 = load i8*, i8** %5
store i8 0, i8* %60
br label %68
61: ; preds = %56
%62 = load i8*, i8** %5
%63 = load i8*, i8** %6
%64 = load i8*, i8** %6
%65 = call i64 @strlen(i8* %64)
%66 = add nsw i64 %65, 1
%67 = call i32 @memmove(i8* %62, i8* %63, i64 %66)
br label %68
68: ; preds = %61, %59
br label %36
69: ; preds = %42, %34
ret void
}

LLVM IR (-O2):
define void @Info_RemoveKey(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i64 @Info_Validate(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ 0, %2 ], [ %7, %4 ]
%10 = tail call i32 @assert(i32 %9)
%11 = icmp eq i8* %1, null
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = tail call i64 @Info_ValidateKey(i8* %1)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %12, %8
%17 = phi i32 [ 0, %8 ], [ %15, %12 ]
%18 = tail call i32 @assert(i32 %17)
%19 = tail call i64 @Info_Validate(i8* %0)
%20 = icmp eq i64 %19, 0
br i1 %20, label %44, label %21
21: ; preds = %16
%22 = tail call i64 @Info_ValidateKey(i8* %1)
%23 = icmp eq i64 %22, 0
br i1 %23, label %44, label %24
24: ; preds = %21
%25 = tail call i8* @Info_FindKey(i8* %0, i8* %1)
%26 = icmp eq i8* %25, null
br i1 %26, label %44, label %27
27: ; preds = %24, %41
%28 = phi i8* [ %42, %41 ], [ %25, %24 ]
%29 = getelementptr inbounds i8, i8* %28, i64 1
%30 = tail call i8* @strchr(i8* %29, i8 signext 92)
%31 = icmp eq i8* %30, null
br i1 %31, label %36, label %32
32: ; preds = %27
%33 = getelementptr inbounds i8, i8* %30, i64 1
%34 = tail call i8* @strchr(i8* %33, i8 signext 92)
%35 = icmp eq i8* %34, null
br i1 %35, label %36, label %37
36: ; preds = %27, %32
store i8 0, i8* %28
br label %41
37: ; preds = %32
%38 = tail call i64 @strlen(i8* %34)
%39 = add nsw i64 %38, 1
%40 = tail call i32 @memmove(i8* %28, i8* %34, i64 %39)
br label %41
41: ; preds = %36, %37
%42 = tail call i8* @Info_FindKey(i8* %0, i8* %1)
%43 = icmp eq i8* %42, null
br i1 %43, label %44, label %27
44: ; preds = %41, %24, %16, %21
ret void
}