#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 *);
char *Info_ValueForKey(char *s, char *key) {
  char pkey[512];
  static char value[8][512];
  static int valueindex = 0;
  char *o;
  valueindex = (valueindex + 1) & 0x07;
  if (*s == '\\')
    s++;
  while (1) {
    o = pkey;
    while (*s != '\\') {
      if (!*s)
        return "";
      *o++ = *s++;
    }
    *o = 0;
    s++;
    o = value[valueindex];
    while (*s != '\\' && *s) {
      if (!*s)
        return "";
      *o++ = *s++;
    }
    *o = 0;
    if (!strcmp(key, pkey))
      return value[valueindex];
    if (!*s)
      return "";
    s++;
  }
}


x86 assembly (clang, -O0):
<Info_ValueForKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x3f17(%rip),%eax
add    $0x1,%eax
and    $0x7,%eax
mov    %eax,0x3f0b(%rip)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1151 <Info_ValueForKey+0x41>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1156 <Info_ValueForKey+0x46>
lea    -0x220(%rbp),%rax
mov    %rax,-0x228(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     11be <Info_ValueForKey+0xae>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1191 <Info_ValueForKey+0x81>
lea    0xe78(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <Info_ValueForKey+0x1d7>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x228(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x228(%rbp)
mov    %cl,(%rax)
jmp    1164 <Info_ValueForKey+0x54>
mov    -0x228(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
movslq 0x3e65(%rip),%rcx
lea    0x2e5e(%rip),%rax
shl    $0x9,%rcx
add    %rcx,%rax
mov    %rax,-0x228(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x5c,%ecx
mov    %al,-0x229(%rbp)
je     121b <Info_ValueForKey+0x10b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x229(%rbp)
mov    -0x229(%rbp),%al
test   $0x1,%al
jne    122e <Info_ValueForKey+0x11e>
jmp    1278 <Info_ValueForKey+0x168>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    124b <Info_ValueForKey+0x13b>
lea    0xdbe(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <Info_ValueForKey+0x1d7>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x228(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x228(%rbp)
mov    %cl,(%rax)
jmp    11f0 <Info_ValueForKey+0xe0>
mov    -0x228(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
lea    -0x220(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    12b9 <Info_ValueForKey+0x1a9>
movslq 0x3d9e(%rip),%rcx
lea    0x2d97(%rip),%rax
shl    $0x9,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <Info_ValueForKey+0x1d7>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    12d6 <Info_ValueForKey+0x1c6>
lea    0xd33(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <Info_ValueForKey+0x1d7>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1156 <Info_ValueForKey+0x46>
mov    -0x8(%rbp),%rax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Info_ValueForKey>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r14
mov    %rsp,%r12
mov    0x3f14(%rip),%eax
add    $0x1,%eax
and    $0x7,%eax
mov    %eax,0x3f08(%rip)
xor    %ebx,%ebx
cmpb   $0x5c,(%rdi)
sete   %bl
add    %rdi,%rbx
shl    $0x9,%rax
lea    0x2ef2(%rip),%r13
add    %rax,%r13
lea    0xea8(%rip),%r15
mov    %r12,%rax
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%cl
cmp    $0x5c,%cl
je     1180 <Info_ValueForKey+0x70>
test   %cl,%cl
je     11d0 <Info_ValueForKey+0xc0>
add    $0x1,%rbx
mov    %cl,(%rax)
add    $0x1,%rax
jmp    1160 <Info_ValueForKey+0x50>
nopw   0x0(%rax,%rax,1)
movb   $0x0,(%rax)
add    $0x2,%rbx
mov    %r13,%rax
nopw   0x0(%rax,%rax,1)
movzbl -0x1(%rbx),%ecx
test   %cl,%cl
je     11b0 <Info_ValueForKey+0xa0>
cmp    $0x5c,%cl
je     11b0 <Info_ValueForKey+0xa0>
mov    %cl,(%rax)
add    $0x1,%rax
add    $0x1,%rbx
jmp    1190 <Info_ValueForKey+0x80>
nopl   0x0(%rax)
movb   $0x0,(%rax)
mov    %r14,%rdi
mov    %r12,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11cd <Info_ValueForKey+0xbd>
cmpb   $0x0,-0x1(%rbx)
mov    %r12,%rax
jne    1160 <Info_ValueForKey+0x50>
jmp    11d0 <Info_ValueForKey+0xc0>
mov    %r13,%r15
mov    %r15,%rax
add    $0x200,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@Info_ValueForKey.value = internal global [8 x [512 x i8]] zeroinitializer
@Info_ValueForKey.valueindex = internal unnamed_addr global i32 0
@.str = [1 x i8] zeroinitializer
define i8* @Info_ValueForKey(i8* nocapture %0, i8* nocapture %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @Info_ValueForKey.valueindex
%6 = add nsw i32 %5, 1
%7 = and i32 %6, 7
store i32 %7, i32* @Info_ValueForKey.valueindex
%8 = load i8, i8* %0
%9 = icmp eq i8 %8, 92
%10 = zext i1 %9 to i64
%11 = getelementptr i8, i8* %0, i64 %10
%12 = zext i32 %7 to i64
%13 = getelementptr inbounds [8 x [512 x i8]], [8 x [512 x i8]]* @Info_ValueForKey.value, i64 0, i64 %12, i64 0
br label %14
14: ; preds = %21, %2
%15 = phi i8* [ %11, %2 ], [ %22, %21 ]
%16 = phi i8* [ %4, %2 ], [ %23, %21 ]
%17 = load i8, i8* %15
switch i8 %17, label %18 [
i8 92, label %24
i8 0, label %39
]
18: ; preds = %14
%19 = getelementptr inbounds i8, i8* %15, i64 1
%20 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %17, i8* %16
br label %21
21: ; preds = %18, %35
%22 = phi i8* [ %19, %18 ], [ %38, %35 ]
%23 = phi i8* [ %20, %18 ], [ %4, %35 ]
br label %14
24: ; preds = %14
store i8 0, i8* %16
br label %25
25: ; preds = %30, %24
%26 = phi i8* [ %15, %24 ], [ %28, %30 ]
%27 = phi i8* [ %13, %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* %4)
%34 = icmp eq i32 %33, 0
br i1 %34, label %39, label %35
35: ; preds = %32
%36 = load i8, i8* %28
%37 = icmp eq i8 %36, 0
%38 = getelementptr inbounds i8, i8* %26, i64 2
br i1 %37, label %39, label %21
39: ; preds = %32, %35, %14
%40 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %14 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %35 ], [ %13, %32 ]
ret i8* %40
}