#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*/ hasadjective(int, int);
int /*<<< orphan*/ hasnoun(int, int);
int match(int obj, int noun, int *adjs) {
  int *aptr;
  if (!hasnoun(obj, noun))
    return (0);
  for (aptr = adjs; *aptr != 0; aptr++)
    if (!hasadjective(obj, *aptr))
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <hasnoun@plt>
cmp    $0x0,%eax
jne    1152 <match+0x32>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <match+0x87>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
je     11a0 <match+0x80>
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
call   1040 <hasadjective@plt>
cmp    $0x0,%eax
jne    118a <match+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <match+0x87>
jmp    118f <match+0x6f>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    115a <match+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %edi,%ebp
call   1030 <hasnoun@plt>
xor    %r14d,%r14d
test   %eax,%eax
je     115b <match+0x3b>
mov    (%rbx),%esi
test   %esi,%esi
je     1155 <match+0x35>
add    $0x4,%rbx
nop
mov    %ebp,%edi
call   1040 <hasadjective@plt>
test   %eax,%eax
je     115b <match+0x3b>
mov    (%rbx),%esi
add    $0x4,%rbx
test   %esi,%esi
jne    1140 <match+0x20>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @match(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @hasnoun(i32 %9, i32 %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %3
store i32 0, i32* %4
br label %32
14: ; preds = %3
%15 = load i32*, i32** %7
store i32* %15, i32** %8
br label %16
16: ; preds = %28, %14
%17 = load i32*, i32** %8
%18 = load i32, i32* %17
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %31
20: ; preds = %16
%21 = load i32, i32* %5
%22 = load i32*, i32** %8
%23 = load i32, i32* %22
%24 = call i32 @hasadjective(i32 %21, i32 %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %20
store i32 0, i32* %4
br label %32
27: ; preds = %20
br label %28
28: ; preds = %27
%29 = load i32*, i32** %8
%30 = getelementptr inbounds i32, i32* %29, i32 1
store i32* %30, i32** %8
br label %16
31: ; preds = %16
store i32 1, i32* %4
br label %32
32: ; preds = %31, %26, %13
%33 = load i32, i32* %4
ret i32 %33
}

LLVM IR (-O2):
define i32 @match(i32 %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @hasnoun(i32 %0, i32 %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %18, label %12
9: ; preds = %12
%10 = load i32, i32* %17
%11 = icmp eq i32 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %6, %9
%13 = phi i32 [ %10, %9 ], [ %7, %6 ]
%14 = phi i32* [ %17, %9 ], [ %2, %6 ]
%15 = tail call i32 @hasadjective(i32 %0, i32 %13)
%16 = icmp eq i32 %15, 0
%17 = getelementptr inbounds i32, i32* %14, i64 1
br i1 %16, label %18, label %9
18: ; preds = %12, %9, %6, %3
%19 = phi i32 [ 0, %3 ], [ 1, %6 ], [ 0, %12 ], [ 1, %9 ]
ret i32 %19
}