#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 const *, char);
int strlen(char *);
int /*<<< orphan*/ strtrim(char *);
char *get_value(const char *s) {
  char *value = NULL;
  value = strchr(s, '=');
  if (!value)
    return NULL;
  ++value;
  strtrim(value);
  if (*value == '"' && *(value + strlen(value) - 1) == '"') {
    *(value + strlen(value) - 1) = 0;
    value++;
  }
  return value;
}


x86 assembly (clang, -O0):
<get_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116e <get_value+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    11ee <get_value+0xbe>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strtrim@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    11e6 <get_value+0xb6>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
movsbl -0x1(%rax,%rcx,1),%eax
cmp    $0x22,%eax
jne    11e6 <get_value+0xb6>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
movb   $0x0,-0x1(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_value>:
push   %r14
push   %rbx
push   %rax
mov    $0x3d,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1181 <get_value+0x51>
mov    %rax,%rbx
lea    0x1(%rax),%r14
mov    %r14,%rdi
call   1050 <strtrim@plt>
cmpb   $0x22,0x1(%rbx)
jne    1184 <get_value+0x54>
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x22,-0x1(%r14,%rax,1)
jne    1184 <get_value+0x54>
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
add    $0x2,%rbx
mov    %rbx,%r14
jmp    1184 <get_value+0x54>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @get_value(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 61)
%3 = icmp eq i8* %2, null
br i1 %3, label %22, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = tail call i32 @strtrim(i8* %5)
%7 = load i8, i8* %5
%8 = icmp eq i8 %7, 34
br i1 %8, label %9, label %22
9: ; preds = %4
%10 = tail call i32 @strlen(i8* %5)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %5, i64 %11
%13 = getelementptr inbounds i8, i8* %12, i64 -1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 34
br i1 %15, label %16, label %22
16: ; preds = %9
%17 = tail call i32 @strlen(i8* %5)
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %5, i64 %18
%20 = getelementptr inbounds i8, i8* %19, i64 -1
store i8 0, i8* %20
%21 = getelementptr inbounds i8, i8* %2, i64 2
br label %22
22: ; preds = %4, %9, %16, %1
%23 = phi i8* [ null, %1 ], [ %21, %16 ], [ %5, %9 ], [ %5, %4 ]
ret i8* %23
}