#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 *_dgst_get_val(char *parameter) {
  char *cursor, *q;
  if (NULL == (cursor = strchr(parameter, '='))) {
    return (char *)NULL;
  }
  if (*(++cursor) != '"') {
    return cursor;
  }
  cursor++;
  if (NULL == (q = strchr(cursor, '"'))) {
    return (char *)NULL;
  }
  *q = '\0';
  return cursor;
}


x86 assembly (clang, -O0):
<_dgst_get_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    1149 <_dgst_get_val+0x39>
movq   $0x0,-0x8(%rbp)
jmp    11ba <_dgst_get_val+0xaa>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x22,%eax
je     1172 <_dgst_get_val+0x62>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11ba <_dgst_get_val+0xaa>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x22,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    11ab <_dgst_get_val+0x9b>
movq   $0x0,-0x8(%rbp)
jmp    11ba <_dgst_get_val+0xaa>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dgst_get_val>:
push   %rbx
mov    $0x3d,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1144 <_dgst_get_val+0x34>
mov    %rax,%rbx
cmpb   $0x22,0x1(%rax)
jne    1148 <_dgst_get_val+0x38>
add    $0x2,%rbx
mov    %rbx,%rdi
mov    $0x22,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1144 <_dgst_get_val+0x34>
movb   $0x0,(%rax)
jmp    114c <_dgst_get_val+0x3c>
xor    %ebx,%ebx
jmp    114c <_dgst_get_val+0x3c>
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_dgst_get_val(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 61)
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 34
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %2, i64 2
%10 = tail call i8* @strchr(i8* %9, i8 signext 34)
%11 = icmp eq i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %8
store i8 0, i8* %10
br label %13
13: ; preds = %8, %4, %1, %12
%14 = phi i8* [ %9, %12 ], [ null, %1 ], [ %5, %4 ], [ null, %8 ]
ret i8* %14
}