#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[2][512];
  static int valueindex;
  char *o;
  valueindex ^= 1;
  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    0x3317(%rip),%eax
xor    $0x1,%eax
mov    %eax,0x330e(%rip)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    114e <Info_ValueForKey+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1153 <Info_ValueForKey+0x43>
lea    -0x220(%rbp),%rax
mov    %rax,-0x228(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     11bb <Info_ValueForKey+0xab>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    118e <Info_ValueForKey+0x7e>
lea    0xe7b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e4 <Info_ValueForKey+0x1d4>
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    1161 <Info_ValueForKey+0x51>
mov    -0x228(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
movslq 0x3268(%rip),%rcx
lea    0x2e61(%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     1218 <Info_ValueForKey+0x108>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x229(%rbp)
mov    -0x229(%rbp),%al
test   $0x1,%al
jne    122b <Info_ValueForKey+0x11b>
jmp    1275 <Info_ValueForKey+0x165>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1248 <Info_ValueForKey+0x138>
lea    0xdc1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e4 <Info_ValueForKey+0x1d4>
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    11ed <Info_ValueForKey+0xdd>
mov    -0x228(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
lea    -0x220(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    12b6 <Info_ValueForKey+0x1a6>
movslq 0x31a1(%rip),%rcx
lea    0x2d9a(%rip),%rax
shl    $0x9,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    12e4 <Info_ValueForKey+0x1d4>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    12d3 <Info_ValueForKey+0x1c3>
lea    0xd36(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e4 <Info_ValueForKey+0x1d4>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1153 <Info_ValueForKey+0x43>
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
movslq 0x3313(%rip),%rax
xor    $0x1,%rax
mov    %eax,0x3309(%rip)
xor    %ebx,%ebx
cmpb   $0x5c,(%rdi)
sete   %bl
add    %rdi,%rbx
shl    $0x9,%rax
lea    0x2ef3(%rip),%r13
add    %rax,%r13
lea    0xea9(%rip),%r15
mov    %r12,%rax
nopw   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 [2 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 = xor i32 %8, 1
store i32 %9, i32* @Info_ValueForKey.valueindex
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 92
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %4
br label %17
17: ; preds = %14, %2
br label %18
18: ; preds = %17, %83
%19 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
store i8* %19, i8** %7
br label %20
20: ; preds = %30, %18
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 92
br i1 %24, label %25, label %36
25: ; preds = %20
%26 = load i8*, i8** %4
%27 = load i8, i8* %26
%28 = icmp ne i8 %27, 0
br i1 %28, label %30, label %29
29: ; preds = %25
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %86
30: ; preds = %25
%31 = load i8*, i8** %4
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %4
%33 = load i8, i8* %31
%34 = load i8*, i8** %7
%35 = getelementptr inbounds i8, i8* %34, i32 1
store i8* %35, i8** %7
store i8 %33, i8* %34
br label %20
36: ; preds = %20
%37 = load i8*, i8** %7
store i8 0, i8* %37
%38 = load i8*, i8** %4
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %4
%40 = load i32, i32* @Info_ValueForKey.valueindex
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [2 x [512 x i8]], [2 x [512 x i8]]* @Info_ValueForKey.value, i64 0, i64 %41
%43 = getelementptr inbounds [512 x i8], [512 x i8]* %42, i64 0, i64 0
store i8* %43, i8** %7
br label %44
44: ; preds = %61, %36
%45 = load i8*, i8** %4
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %47, 92
br i1 %48, label %49, label %54
49: ; preds = %44
%50 = load i8*, i8** %4
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp ne i32 %52, 0
br label %54
54: ; preds = %49, %44
%55 = phi i1 [ false, %44 ], [ %53, %49 ]
br i1 %55, label %56, label %67
56: ; preds = %54
%57 = load i8*, i8** %4
%58 = load i8, i8* %57
%59 = icmp ne i8 %58, 0
br i1 %59, label %61, label %60
60: ; preds = %56
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %86
61: ; preds = %56
%62 = load i8*, i8** %4
%63 = getelementptr inbounds i8, i8* %62, i32 1
store i8* %63, i8** %4
%64 = load i8, i8* %62
%65 = load i8*, i8** %7
%66 = getelementptr inbounds i8, i8* %65, i32 1
store i8* %66, i8** %7
store i8 %64, i8* %65
br label %44
67: ; preds = %54
%68 = load i8*, i8** %7
store i8 0, i8* %68
%69 = load i8*, i8** %5
%70 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%71 = call i32 @strcmp(i8* %69, i8* %70)
%72 = icmp ne i32 %71, 0
br i1 %72, label %78, label %73
73: ; preds = %67
%74 = load i32, i32* @Info_ValueForKey.valueindex
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [2 x [512 x i8]], [2 x [512 x i8]]* @Info_ValueForKey.value, i64 0, i64 %75
%77 = getelementptr inbounds [512 x i8], [512 x i8]* %76, i64 0, i64 0
store i8* %77, i8** %3
br label %86
78: ; preds = %67
%79 = load i8*, i8** %4
%80 = load i8, i8* %79
%81 = icmp ne i8 %80, 0
br i1 %81, label %83, label %82
82: ; preds = %78
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %86
83: ; preds = %78
%84 = load i8*, i8** %4
%85 = getelementptr inbounds i8, i8* %84, i32 1
store i8* %85, i8** %4
br label %18
86: ; preds = %82, %73, %60, %29
%87 = load i8*, i8** %3
ret i8* %87
}

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