#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 */
struct lvar_leaf_entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ e_char(struct lvar_leaf_entry const *);
int e_keysize(struct lvar_leaf_entry const *);
int /*<<< orphan*/ memcmp(int /*<<< orphan*/, char const *, int);
int e_eq(const struct lvar_leaf_entry *ent, const char *name, int namelen) {
  return namelen == e_keysize(ent) && !memcmp(e_char(ent), name, namelen);
}


x86 assembly (clang, -O0):
<e_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <e_keysize@plt>
mov    -0x1c(%rbp),%ecx
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x15(%rbp)
jne    1186 <e_eq+0x56>
mov    -0x8(%rbp),%rdi
call   1050 <e_char@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_eq>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <e_keysize@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebp,%ecx
jne    1166 <e_eq+0x36>
mov    %rbx,%rdi
call   1050 <e_char@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.lvar_leaf_entry = type { i32 }
define i32 @e_eq(%struct.lvar_leaf_entry* %0, i8* %1, i32 %2) {
%4 = alloca %struct.lvar_leaf_entry*
%5 = alloca i8*
%6 = alloca i32
store %struct.lvar_leaf_entry* %0, %struct.lvar_leaf_entry** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load %struct.lvar_leaf_entry*, %struct.lvar_leaf_entry** %4
%9 = call i32 @e_keysize(%struct.lvar_leaf_entry* %8)
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %19
11: ; preds = %3
%12 = load %struct.lvar_leaf_entry*, %struct.lvar_leaf_entry** %4
%13 = call i32 @e_char(%struct.lvar_leaf_entry* %12)
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @memcmp(i32 %13, i8* %14, i32 %15)
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
br label %19
19: ; preds = %11, %3
%20 = phi i1 [ false, %3 ], [ %18, %11 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.lvar_leaf_entry = type { i32 }
define i32 @e_eq(%struct.lvar_leaf_entry* %0, i8* %1, i32 %2) {
%4 = tail call i32 @e_keysize(%struct.lvar_leaf_entry* %0)
%5 = icmp eq i32 %4, %2
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = tail call i32 @e_char(%struct.lvar_leaf_entry* %0)
%8 = tail call i32 @memcmp(i32 %7, i8* %1, i32 %2)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %3
%12 = phi i32 [ 0, %3 ], [ %10, %6 ]
ret i32 %12
}