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


x86 assembly (clang, -O0):
<Info_ValueForKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x3717(%rip),%eax
add    $0x1,%eax
mov    %eax,0x370e(%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     11b0 <Info_ValueForKey+0xa0>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1183 <Info_ValueForKey+0x73>
jmp    12bb <Info_ValueForKey+0x1ab>
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)
mov    0x3674(%rip),%eax
and    $0x3,%eax
movslq %eax,%rcx
lea    0x2e67(%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     1212 <Info_ValueForKey+0x102>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x229(%rbp)
mov    -0x229(%rbp),%al
test   $0x1,%al
jne    1225 <Info_ValueForKey+0x115>
jmp    1252 <Info_ValueForKey+0x142>
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    11e7 <Info_ValueForKey+0xd7>
mov    -0x228(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
lea    -0x220(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1298 <Info_ValueForKey+0x188>
mov    0x35c5(%rip),%eax
and    $0x3,%eax
movslq %eax,%rcx
lea    0x2db8(%rip),%rax
shl    $0x9,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    12f1 <Info_ValueForKey+0x1e1>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    12aa <Info_ValueForKey+0x19a>
jmp    12bb <Info_ValueForKey+0x1ab>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1153 <Info_ValueForKey+0x43>
mov    0x357f(%rip),%eax
and    $0x3,%eax
movslq %eax,%rcx
lea    0x2d72(%rip),%rax
shl    $0x9,%rcx
add    %rcx,%rax
mov    %rax,-0x228(%rbp)
mov    -0x228(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x228(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Info_ValueForKey>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rsi,%r14
mov    %rsp,%r15
mov    0x3716(%rip),%eax
add    $0x1,%eax
mov    %eax,0x370d(%rip)
xor    %ebx,%ebx
cmpb   $0x5c,(%rdi)
sete   %bl
add    %rdi,%rbx
and    $0x3,%eax
shl    $0x9,%rax
lea    0x2ef4(%rip),%r12
add    %rax,%r12
mov    %r15,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx),%cl
cmp    $0x5c,%cl
je     1180 <Info_ValueForKey+0x70>
test   %cl,%cl
je     11cb <Info_ValueForKey+0xbb>
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    %r12,%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    %r15,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11d0 <Info_ValueForKey+0xc0>
cmpb   $0x0,-0x1(%rbx)
mov    %r15,%rax
jne    1160 <Info_ValueForKey+0x50>
movb   $0x0,(%r12)
mov    %r12,%rax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@Info_ValueForKey.value = internal global [4 x [512 x i8]] zeroinitializer
@Info_ValueForKey.valueindex = internal global i32 0
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
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, %80
%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
br label %83
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 = and i32 %40, 3
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [4 x [512 x i8]], [4 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 = %57, %36
%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 %63
57: ; preds = %55
%58 = load i8*, i8** %4
%59 = getelementptr inbounds i8, i8* %58, i32 1
store i8* %59, i8** %4
%60 = load i8, i8* %58
%61 = load i8*, i8** %7
%62 = getelementptr inbounds i8, i8* %61, i32 1
store i8* %62, i8** %7
store i8 %60, i8* %61
br label %45
63: ; preds = %55
%64 = load i8*, i8** %7
store i8 0, i8* %64
%65 = load i8*, i8** %5
%66 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%67 = call i32 @strcmp(i8* %65, i8* %66)
%68 = icmp ne i32 %67, 0
br i1 %68, label %75, label %69
69: ; preds = %63
%70 = load i32, i32* @Info_ValueForKey.valueindex
%71 = and i32 %70, 3
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [4 x [512 x i8]], [4 x [512 x i8]]* @Info_ValueForKey.value, i64 0, i64 %72
%74 = getelementptr inbounds [512 x i8], [512 x i8]* %73, i64 0, i64 0
store i8* %74, i8** %3
br label %91
75: ; preds = %63
%76 = load i8*, i8** %4
%77 = load i8, i8* %76
%78 = icmp ne i8 %77, 0
br i1 %78, label %80, label %79
79: ; preds = %75
br label %83
80: ; preds = %75
%81 = load i8*, i8** %4
%82 = getelementptr inbounds i8, i8* %81, i32 1
store i8* %82, i8** %4
br label %18
83: ; preds = %79, %29
%84 = load i32, i32* @Info_ValueForKey.valueindex
%85 = and i32 %84, 3
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [4 x [512 x i8]], [4 x [512 x i8]]* @Info_ValueForKey.value, i64 0, i64 %86
%88 = getelementptr inbounds [512 x i8], [512 x i8]* %87, i64 0, i64 0
store i8* %88, i8** %7
%89 = load i8*, i8** %7
store i8 0, i8* %89
%90 = load i8*, i8** %7
store i8* %90, i8** %3
br label %91
91: ; preds = %83, %69
%92 = load i8*, i8** %3
ret i8* %92
}

LLVM IR (-O2):
@Info_ValueForKey.value = internal global [4 x [512 x i8]] zeroinitializer
@Info_ValueForKey.valueindex = internal unnamed_addr global i32 0
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
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 = and i32 %6, 3
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds [4 x [512 x i8]], [4 x [512 x i8]]* @Info_ValueForKey.value, i64 0, i64 %12, i64 0
br label %14
14: ; preds = %21, %2
%15 = phi i8* [ %10, %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 %40, 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 = %35, %14
store i8 0, i8* %13
br label %40
40: ; preds = %32, %39
ret i8* %13
}