#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 map_node {
  int dummy;
};
struct map {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
struct map_node *map_get_node(struct map *, char *, size_t);
int map_ihas(struct map *m, char *key, size_t len) {
  assert(m != NULL);
  assert(key != NULL);
  struct map_node *node = map_get_node(m, key, len);
  if (node != NULL)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<map_ihas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <map_get_node@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1184 <map_ihas+0x64>
movl   $0x1,-0x4(%rbp)
jmp    118b <map_ihas+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_ihas>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <map_get_node@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.map = type { i32 }
%struct.map_node = type { i32 }
define i32 @map_ihas(%struct.map* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca %struct.map*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.map_node*
store %struct.map* %0, %struct.map** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%9 = load %struct.map*, %struct.map** %5
%10 = icmp ne %struct.map* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %6
%14 = icmp ne i8* %13, null
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load %struct.map*, %struct.map** %5
%18 = load i8*, i8** %6
%19 = load i64, i64* %7
%20 = call %struct.map_node* @map_get_node(%struct.map* %17, i8* %18, i64 %19)
store %struct.map_node* %20, %struct.map_node** %8
%21 = load %struct.map_node*, %struct.map_node** %8
%22 = icmp ne %struct.map_node* %21, null
br i1 %22, label %23, label %24
23: ; preds = %3
store i32 1, i32* %4
br label %25
24: ; preds = %3
store i32 0, i32* %4
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
%struct.map = type { i32 }
%struct.map_node = type { i32 }
define i32 @map_ihas(%struct.map* %0, i8* %1, i64 %2) {
%4 = icmp ne %struct.map* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp ne i8* %1, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call %struct.map_node* @map_get_node(%struct.map* %0, i8* %1, i64 %2)
%11 = icmp ne %struct.map_node* %10, null
%12 = zext i1 %11 to i32
ret i32 %12
}