#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*/ evf_eat_spaces(char **);
scalar_t__ isspace(char);
char *evfilter_get_name(char **str) {
  char *name;
  evf_eat_spaces(str);
  name = *str;
  for (; **str != '\0'; (*str)++) {
    if (isspace(**str) || **str == '=') {
      **str = '\0';
      (*str)++;
      break;
    }
  }
  evf_eat_spaces(str);
  if (**str == '=')
    (*str)++;
  return name;
}


x86 assembly (clang, -O0):
<evfilter_get_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <evf_eat_spaces@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11b4 <evfilter_get_name+0x94>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
jne    117f <evfilter_get_name+0x5f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    119c <evfilter_get_name+0x7c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    11b4 <evfilter_get_name+0x94>
jmp    11a1 <evfilter_get_name+0x81>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1140 <evfilter_get_name+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <evf_eat_spaces@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    11de <evfilter_get_name+0xbe>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evfilter_get_name>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <evf_eat_spaces@plt>
mov    (%rbx),%r14
mov    (%r14),%al
test   %al,%al
je     116d <evfilter_get_name+0x4d>
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%edi
call   1040 <isspace@plt>
mov    (%rbx),%rcx
test   %rax,%rax
jne    1166 <evfilter_get_name+0x46>
cmpb   $0x3d,(%rcx)
je     1166 <evfilter_get_name+0x46>
lea    0x1(%rcx),%rax
mov    %rax,(%rbx)
movzbl 0x1(%rcx),%eax
test   %al,%al
jne    1140 <evfilter_get_name+0x20>
jmp    116d <evfilter_get_name+0x4d>
movb   $0x0,(%rcx)
addq   $0x1,(%rbx)
mov    %rbx,%rdi
call   1030 <evf_eat_spaces@plt>
mov    (%rbx),%rax
cmpb   $0x3d,(%rax)
jne    1184 <evfilter_get_name+0x64>
add    $0x1,%rax
mov    %rax,(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @evfilter_get_name(i8** %0) {
%2 = tail call i32 @evf_eat_spaces(i8** %0)
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %21, label %6
6: ; preds = %1, %17
%7 = phi i8 [ %19, %17 ], [ %4, %1 ]
%8 = tail call i64 @isspace(i8 signext %7)
%9 = icmp eq i64 %8, 0
%10 = load i8*, i8** %0
br i1 %9, label %11, label %14
11: ; preds = %6
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 61
br i1 %13, label %14, label %17
14: ; preds = %11, %6
store i8 0, i8* %10
%15 = load i8*, i8** %0
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %0
br label %21
17: ; preds = %11
%18 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %18, i8** %0
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %6
21: ; preds = %17, %1, %14
%22 = tail call i32 @evf_eat_spaces(i8** %0)
%23 = load i8*, i8** %0
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 61
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = getelementptr inbounds i8, i8* %23, i64 1
store i8* %27, i8** %0
br label %28
28: ; preds = %26, %21
ret i8* %3
}