#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 *strchr(char *, char);
char *get_value(char *buf) {
  char *s = strchr(buf, '=');
  s++;
  if (*s == '\'' || *s == '"')
    s++;
  char *p = s;
  p = strchr(buf, '\'');
  if (p)
    p = 0;
  p = strchr(buf, '"');
  if (p)
    p = 0;
  return s;
}


x86 assembly (clang, -O0):
<get_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
je     115a <get_value+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1166 <get_value+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x27,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1193 <get_value+0x83>
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x22,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11b8 <get_value+0xa8>
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_value>:
push   %rax
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    0x1(%rax),%cl
cmp    $0x27,%cl
je     1128 <get_value+0x18>
cmp    $0x22,%cl
jne    112e <get_value+0x1e>
add    $0x2,%rax
pop    %rcx
ret
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @get_value(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strchr(i8* %5, i8 signext 61)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 39
br i1 %12, label %18, label %13
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 34
br i1 %17, label %18, label %21
18: ; preds = %13, %1
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %21
21: ; preds = %18, %13
%22 = load i8*, i8** %3
store i8* %22, i8** %4
%23 = load i8*, i8** %2
%24 = call i8* @strchr(i8* %23, i8 signext 39)
store i8* %24, i8** %4
%25 = load i8*, i8** %4
%26 = icmp ne i8* %25, null
br i1 %26, label %27, label %28
27: ; preds = %21
store i8* null, i8** %4
br label %28
28: ; preds = %27, %21
%29 = load i8*, i8** %2
%30 = call i8* @strchr(i8* %29, i8 signext 34)
store i8* %30, i8** %4
%31 = load i8*, i8** %4
%32 = icmp ne i8* %31, null
br i1 %32, label %33, label %34
33: ; preds = %28
store i8* null, i8** %4
br label %34
34: ; preds = %33, %28
%35 = load i8*, i8** %3
ret i8* %35
}

LLVM IR (-O2):
define i8* @get_value(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 61)
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 39, label %5
i8 34, label %5
]
5: ; preds = %1, %1
%6 = getelementptr inbounds i8, i8* %2, i64 2
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %6, %5 ], [ %3, %1 ]
ret i8* %8
}